File: USCounties.R

package info (click to toggle)
rmatrix 1.7-5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,156 kB
  • sloc: ansic: 97,207; makefile: 280; sh: 165
file content (20 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
stopifnot(requireNamespace("Matrix" , quietly = TRUE)) # includes 'methods'

USCounties <-
    local({
	load(system.file(file.path("external", "USCounties_slots.rda"),
                         package = "Matrix"))
	## -> 'L'
	r <- methods::new("dsCMatrix")
        `slot<-` <- methods::`slot<-`
	for (n in c("Dim", "i","p","x"))
	    slot(r, n) <- L[[n]]
	r
    })

## The reverse:
if(FALSE) {
 L <- list()
 for (n in c("Dim", "i","p","x"))    L[[n]] <- slot(USCounties, n)
}