An R6 class that provides an interface to a folder-based data storage system for the evoland package. Each table is stored as a parquet (or CSV) file. This class uses DuckDB for in-memory SQL operations while persisting data to disk in parquet format for better compression.
Inherits from parquet_duckdb for generic database operations.
See also
Additional methods and active bindings are added to this class in separate files:
evoland_db_tables - Table active bindings (coords_t, lulc_data_t, etc.)
evoland_db_views - View active bindings (lulc_meta_long_v, etc.) and methods
evoland_db_neighbors - Neighbor analysis methods
Super class
evoland::parquet_duckdb -> evoland_db
Methods
Inherited methods
evoland::parquet_duckdb$attach_table()evoland::parquet_duckdb$commit()evoland::parquet_duckdb$delete_from()evoland::parquet_duckdb$detach_table()evoland::parquet_duckdb$execute()evoland::parquet_duckdb$get_query()evoland::parquet_duckdb$list_tables()evoland::parquet_duckdb$print()evoland::parquet_duckdb$row_count()evoland::parquet_duckdb$with_tables()
Method set_neighbors()
Usage
evoland_db$set_neighbors(
max_distance = 1000,
distance_breaks = c(0, 100, 500, 1000),
resolution = 100,
overwrite = FALSE
)Method new()
Initialize a new evoland_db object
Usage
evoland_db$new(path, default_format = c("parquet", "csv"), ...)Method fetch()
Fetch data from storage with evoland-specific view support
Method set_coords()
Set coordinates for DB. Cannot overwrite existing table (would mean cascading deletion)
Usage
evoland_db$set_coords(type = c("square"), ...)Arguments
typestring; which type of coordinates to set, see coords_t
...named arguments are passed to the appropriate coordinate creator function
Method set_periods()
Set periods for DB. See periods_t
Usage
evoland_db$set_periods(
period_length_str = "P10Y",
start_observed = "1985-01-01",
end_observed = "2020-01-01",
end_extrapolated = "2060-01-01"
)Arguments
period_length_strISO 8601 duration string specifying the length of each period (currently only accepting years, e.g., "P5Y" for 5 years)
start_observedStart date of the observed data (YYYY-MM-DD)
end_observedEnd date of the observed data (YYYY-MM-DD)
end_extrapolatedEnd date for extrapolation time range (YYYY-MM-DD)
Method add_predictor()
Add a predictor to the database
Arguments
pred_specList of predictor specification; see
create_pred_meta_t()pred_dataAn object that can be coerced to
pred_data_t, but doesn't have anid_predpred_typePassed to
as_pred_data_t(); one of float, int, bool
Method fit_full_models()
Usage
evoland_db$fit_full_models(
partial_models,
gof_criterion,
maximize = TRUE,
na_value = NA,
envir = parent.frame()
)