Page

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 https://github.com/AtlasOfLivingAustralia/ALA4R/issues/ or email to support@ala.org.au",
   support_email = "support@ala.org.au",
   reasons_function = "ala_reasons",
   fields_function = "ala_fields",
   occurrences_function = "occurrences",
   config_function = "ala_config",
   base_url_spatial = "https://spatial.ala.org.au/layers-service/",
   base_url_bie = "http://bie.ala.org.au/ws/",
   base_url_biocache = "https://bioatlas.se/biocache-service",
   base_url_images = "https://bioatlas.se/images/",
   base_url_logger = "https://bioatlas.se/logger-service/service/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.