if (FALSE) { # identical(tolower(Sys.getenv("NOT_CRAN")), "true")
data_dir <- system.file("extdata", package = "accessibility")
travel_matrix <- readRDS(file.path(data_dir, "travel_matrix.rds"))
land_use_data <- readRDS(file.path(data_dir, "land_use_data.rds"))
# 2SFCA with a step decay function
df <- floating_catchment_area(
travel_matrix,
land_use_data,
method = "2sfca",
decay_function = decay_binary(cutoff = 50),
opportunity = "jobs",
travel_cost = "travel_time",
demand = "population"
)
head(df)
# BFCA with an exponential decay function
df <- floating_catchment_area(
travel_matrix,
land_use_data,
method = "bfca",
decay_function = decay_exponential(decay_value = 0.5),
opportunity = "jobs",
travel_cost = "travel_time",
demand = "population"
)
head(df)
}
Run the code above in your browser using DataLab