Description Usage Arguments Value Note Examples
Converts R objects to sf::sf objects, but supports a wider range of input data than sf::st_as_sf.
1 2 3 4 5 6 7 8 9 10 | smart_as_sf(x, ...)
## Default S3 method:
smart_as_sf(x, ...)
## S3 method for class 'data.frame'
smart_as_sf(x, ...)
## S3 method for class 'character'
smart_as_sf(x, ...)
|
x |
any of the following:
|
... |
ignored |
an sf::sf data.frame
smart_as_sf.default()
looks if an sf::st_as_sf()
,
sf::st_as_sfc()
or as_coord_matrix()
method exists for x
(in
that order). If you are a package developer and want to support smartmap
for a custom S3 class in your package, it is enough to provide one of these
methods.
1 2 | smart_as_sf(data.frame(lat = c(1,2,3), longitude = c(3,4,5)))
smart_as_sf(c(1, 2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.