Examples for 'sfheaders::sfc_multipoint'


sfc MULTIPOINT

Aliases: sfc_multipoint

Keywords:

### ** Examples


x <- matrix( c(1:4), ncol = 2 )
sfc_multipoint( x )
[[1]]
     [,1] [,2]
[1,]    1    3
[2,]    2    4
attr(,"class")
[1] "XY"         "MULTIPOINT" "sfg"       

attr(,"n_empty")
[1] 0
attr(,"crs")
$input
[1] NA

$wkt
[1] NA

attr(,"class")
[1] "crs"
attr(,"class")
[1] "sfc_MULTIPOINT" "sfc"           
attr(,"precision")
[1] 0
attr(,"bbox")
xmin ymin xmax ymax 
   1    3    2    4 
attr(,"class")
[1] "bbox"
x <- data.frame( id = 1:2, x = 1:2, y = 2:1 )
sfc_multipoint( x )
[[1]]
     [,1] [,2] [,3]
[1,]    1    1    2
[2,]    2    2    1
attr(,"class")
[1] "XYZ"        "MULTIPOINT" "sfg"       

attr(,"n_empty")
[1] 0
attr(,"crs")
$input
[1] NA

$wkt
[1] NA

attr(,"class")
[1] "crs"
attr(,"class")
[1] "sfc_MULTIPOINT" "sfc"           
attr(,"precision")
[1] 0
attr(,"bbox")
xmin ymin xmax ymax 
   1    1    2    2 
attr(,"class")
[1] "bbox"
attr(,"z_range")
zmin zmax 
   1    2 
attr(,"class")
[1] "z_range"
sfc_multipoint( x, x = "x", y = "y" )
[[1]]
     [,1] [,2]
[1,]    1    2
[2,]    2    1
attr(,"class")
[1] "XY"         "MULTIPOINT" "sfg"       

attr(,"n_empty")
[1] 0
attr(,"crs")
$input
[1] NA

$wkt
[1] NA

attr(,"class")
[1] "crs"
attr(,"class")
[1] "sfc_MULTIPOINT" "sfc"           
attr(,"precision")
[1] 0
attr(,"bbox")
xmin ymin xmax ymax 
   1    1    2    2 
attr(,"class")
[1] "bbox"
sfc_multipoint( x, x = "y", y = "x" )
[[1]]
     [,1] [,2]
[1,]    2    1
[2,]    1    2
attr(,"class")
[1] "XY"         "MULTIPOINT" "sfg"       

attr(,"n_empty")
[1] 0
attr(,"crs")
$input
[1] NA

$wkt
[1] NA

attr(,"class")
[1] "crs"
attr(,"class")
[1] "sfc_MULTIPOINT" "sfc"           
attr(,"precision")
[1] 0
attr(,"bbox")
xmin ymin xmax ymax 
   1    1    2    2 
attr(,"class")
[1] "bbox"
sfc_multipoint( x, multipoint_id = "id", x = "x", y = "y")
[[1]]
     [,1] [,2]
[1,]    1    2
attr(,"class")
[1] "XY"         "MULTIPOINT" "sfg"       

[[2]]
     [,1] [,2]
[1,]    2    1
attr(,"class")
[1] "XY"         "MULTIPOINT" "sfg"       

attr(,"n_empty")
[1] 0
attr(,"crs")
$input
[1] NA

$wkt
[1] NA

attr(,"class")
[1] "crs"
attr(,"class")
[1] "sfc_MULTIPOINT" "sfc"           
attr(,"precision")
[1] 0
attr(,"bbox")
xmin ymin xmax ymax 
   1    1    2    2 
attr(,"class")
[1] "bbox"

[Package sfheaders version 0.4.4 Index]