#' @export
extract_tourism <- function(path,
sheet = "Tourism") {
df <- openxlsx::read.xlsx(xlsxFile = path, sheet = sheet)
df <- df[, 1:5]
names(df) <- c('year', 'gva', 'total', 'perc', 'overlap')
df <- dplyr::mutate(df, year = as.integer(year))
# validate
cols = rbind(
data.frame(),
list("year", "integer"),
list("gva", "numeric"),
list("total", "numeric"),
list("perc", "numeric"),
list("overlap", "numeric"),
stringsAsFactors = FALSE
)
names(cols) <- c("name", "type")
validate(
df,
cols = cols,
class_name = "tourism"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.