knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Argentum is an R package that simplifies access to WFS (Web Feature Service) and WMS (Web Map Service) data from various Argentine organizations. This vignette will guide you through the basic usage of the package.
You can install the development version of Argentum from GitHub:
# install.packages("devtools") devtools::install_github("your-username/Argentum")
The first step is to see what organizations have available data:
library(Argentum) # Get list of organizations organizations <- argentum_list_organizations() print(organizations)
This will show you a data frame with organizations and their WFS/WMS URLs.
You can select an organization either interactively or programmatically:
# Interactive selection selected_org <- argentum_select_organization() # Search for specific organizations buenos_aires_org <- argentum_select_organization(search = "Buenos Aires")
Once you've selected an organization, you can see what layers they provide:
# List available layers layers <- argentum_list_layers(selected_org$Name) print(layers)
To import a specific layer:
# Import a specific layer sf_layer <- argentum_import_wfs_layer( wfs_url = selected_org$WFS_URL, layer_name = layers$Name[1] ) # Basic plot of the imported data plot(sf_layer)
For a guided experience, use the interactive import function:
sf_layer <- argentum_interactive_import()
This will guide you through the process step by step.
Argentum includes robust error handling. Here's how to use it:
tryCatch({ sf_layer <- argentum_import_wfs_layer( wfs_url = "http://example.com/wfs", layer_name = "example_layer" ) }, error = function(e) { message("Error occurred: ", e$message) })
For more detailed information about working with WFS and WMS services, see the "Working with WFS/WMS Services" vignette:
vignette("argentum", package = "Argentum")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.