Configuring .Rprofile settings for ALA4R

To be able to retrieve data from the BioAtlas on a local installation of R you first need to prepare some configurations.

Start with creating a text file named .Rprofile in your user’s home directory, with the following content after installing the ALA4R package:

server_config <- list(
   max_occurrence_records = 500000,
   server_max_url_length = 8150,
   brand = "ALA4R",
   notify = "Please use or email to",
   support_email = "",
   reasons_function = "ala_reasons",
   fields_function = "ala_fields",
   occurrences_function = "occurrences",
   config_function = "ala_config",
   base_url_spatial = "",
   base_url_bie = "",
   base_url_biocache = "",
   base_url_images = "",
   base_url_logger = "",
   biocache_version = "1.9",
   verbose = TRUE,
   download_reason_id = 10,
   caching = "off"
if (!"ALA4R_server_config" %in% names(options())) {
   message("\nNo existing ALA4R server config, using Swedish data sources...\n")
   options(ALA4R_server_config = server_config)
} else {
   message("Overwriting existing ALA server config with new...")
   options(ALA4R_server_config = server_config)
message("\n*** Successfully loaded .Rprofile ***\n")

If placed in the home directory, these settings will be loaded when R is loaded, providing a configuration with base_url_* settings pointing to regional Atlas data services for example those used in a specific country – Sweden specifically in the example above.