#' Exportar perfiles en shapefile
#'
#' La función exporta uno o más perfiles de SISINTA descargados o leidos
#' con [get_perfiles()] en formato shapefile. !!! REQUIERE NOMBRES DE
#' COLUMNAS MÁS CORTOS
#'
#' @param perfiles un data.frame con perfiles (salida de [get_perfiles()])
#' @param archivo la ruta al archivo de salida.
#'
#' @examples
#' archivo <- tempfile(fileext = ".shp")
#' # exportar_shapefile(perfiles, archivo)
#'
#' @export
# nocov start
exportar_shapefile <- function(perfiles, archivo) {
perfiles_anidados <- anidar_horizontes(perfiles)
sf_perfil <- sf::st_as_sf(perfiles_anidados,
coords = c("perfil_ubicacion_longitud", "perfil_ubicacion_latitud"),
crs = "+proj=longlat +datum=WGS84")
sf::st_write(sf_perfil, dsn = archivo,
driver = "ESRI Shapefile")
}
# nocov end
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.