Description Usage Arguments Value See Also
A coord_matrix
is a matrix
with two columns named "lon"
and "lat"
to
represent spatial point data. They are used as an intermediary when
converting some R objects to sf::sf()
objects.
as_coord_matrix()
can smartly convert a range of R objects to
coord_matrix
. If you are a package developer and want to add support
for smartmap to your package without having to depend on the heavy sf
package, it is enough to provide an as_coord_matrix()
method.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | as_coord_matrix(x, ...)
## Default S3 method:
as_coord_matrix(x, ...)
## S3 method for class 'numeric'
as_coord_matrix(x, ...)
## S3 method for class 'sf'
as_coord_matrix(x, ...)
## S3 method for class 'sfc_POINT'
as_coord_matrix(x, ...)
## S3 method for class 'matrix'
as_coord_matrix(x, ..., loncol = guess_loncol(x), latcol = guess_latcol(x))
## S3 method for class 'data.frame'
as_coord_matrix(x, ..., loncol = guess_loncol(x), latcol = guess_latcol(x))
|
x |
any of the following:
|
... |
passed on to methods |
loncol, latcol |
|
as_coord_matrix()
returns a coord_matrix
object: A numeric
matrix
with the columns "lon"
and "lat"
(in that order)
https://stackoverflow.com/questions/7309121/preferred-order-of-writing-latitude-longitude-tuples
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.