#' Get Environment Agency demo data
#'
#' @return dataframe of demo data for testing
#' @export
#' @importFrom rlang .data
#' @importFrom dplyr inner_join select
#' @importFrom stats complete.cases
#' @importFrom magrittr `%>%`
#' @importFrom tibble tibble
#' @examples
#' \dontrun{
#' data <- get_demo_data()
#' }
get_demo_data <- function() {
message("Loading demo data")
# Load data
indices <- utils::read.csv(system.file("extdat",
"MACP_OPEN_DATA_METRICS.csv",
package = "leafpacs"
))
predictors <- utils::read.csv(system.file("extdat",
"MACP_OPEN_DATA_SITE.csv",
package = "leafpacs"
))
# Tidy data
data <- inner_join(indices, predictors, by = "SITE_ID")
data <- select(data, -.data$REPLICATE_CODE)
data <- data %>% filter(complete.cases(data))
data <- leafpacs_convert_ea(data)
data <- tibble(data)
return(data)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.