dealWithDf {plusCode2} | R Documentation |
Deal with data frame
Description
Adapt the genPluscode function to a class object (sf, data.frame), it returns a vector containing the pluscode of the coordinates in the records of the input data frame.
Usage
dealWithDf(x, codeLength)
Arguments
x |
An object of class (sf, data.frame). |
codeLength |
A number. |
Value
A character vector of length nrow(x).
Examples
library(sf)
coordinates <- data.frame(lon = -6.56718, lat = 52.50145)
geom_df <- st_as_sf(coordinates, coords = c("lon", "lat"), crs = 4326)
dealWithDf(geom_df, 12)
###
coordinates_df <- data.frame(lon = c(-6.56718, -6), lat = c(52.50145, 52))
geom_df <- st_as_sf(coordinates_df, coords = c("lon", "lat"), crs = 4326)
dealWithDf(geom_df, 12)
[Package plusCode2 version 0.1.0 Index]