The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Package {ACRER}


Type: Package
Title: Accessibility for Recreation in R
Version: 1.0.1
Date: 2026-09-21
Description: Recreation model that simulates household types, group types, expected visiting duration, and total visits from city zip codes to surrounding destination areas. The methodology is based on the accessibility model described in Bervaes et al. (1996) "Een model voor het gebruik van de groene ruimte in stadslandschappen (Fase I)" https://www.wur.nl/en/library, with optimization procedures based on Goldfarb and Idnani (1983) <doi:10.1007/BF02591962> and Vanderbei et al. (1986) <doi:10.1007/BF01840454>.
Depends: R (≥ 3.5.0)
License: GPL (≥ 3)
Encoding: UTF-8
Imports: DBI, data.table, dplyr, knitr, pivottabler, magrittr, quadprog, reshape2, RSQLite, sf, sqldf, tibble, pracma
Suggests: testthat (≥ 3.0.0), rmarkdown, curl, DT, mapview, WriteXLS, flextable, ggmap, htmltools, htmlwidgets, kableExtra, openxlsx, pander, rstudioapi, svDialogs
VignetteBuilder: knitr
NeedsCompilation: no
Config/roxygen2/version: 8.1.0
Packaged: 2026-09-21 13:39:55 UTC; georgiosmartakis
Author: Georgios Martakis [aut, cre], Jan Bervaes [ctb] (deceased), Bert van der Werf ORCID iD [ctb]
Maintainer: Georgios Martakis <georgios.martakis@gmail.com>
Repository: CRAN
Date/Publication: 2026-09-30 09:50:09 UTC

Pipe operator

Description

See magrittr::%>% for details.

Usage

lhs %>% rhs

Arguments

lhs

A value or the magrittr placeholder.

rhs

A function call using the magrittr semantics.

Value

The result of calling 'rhs(lhs)'.


NGroup0 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are NOT interrupted by absences (0). Thus in this case we have 1 group of ones (presences).

Description

NGroup0 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are NOT interrupted by absences (0). Thus in this case we have 1 group of ones (presences).

Usage

NGroup0(
  nRowMatrix,
  activ_segment,
  c1,
  c2,
  sumc1c2,
  sumc1,
  levels_sr,
  Index_group_number,
  groups,
  Nfactors,
  fRecrIDX,
  FRecrID,
  Ngroups,
  fbfactX1,
  fbfactX2,
  Fbfact11,
  Fbfact22
)

Arguments

nRowMatrix

Matrix. Select each row of the cross table if the vector for the rows matrix equals to one.

activ_segment

Matrix. activ_segment construct of the presence/absence of activities-time segment matrix.

c1

Numeric array. Construct the row of the activities pattern factor in which (sumc_of_groups != 0).

c2

Numeric array. Construct the row of the time segment factor in which (sumc_of_groups != 0).

sumc1c2

Numeric vector The sum per column of the presence/absence per block rows of the activities-and time segment without zeros.

sumc1

Numeric vector. The sum of the activ_segment.

levels_sr

Numeric vector. levels_sr levels of the sum of rows

Index_group_number

Numeric vector. Index_group_number the group number

groups

Numeric vector. Groups: 4 6 7 3 1 16 2 34 25 82 31 41 21 19 15 27 37 67 77 when Nfactors are two vectors, the time segment and the activities pattern and the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and groups: 37 1 4 25 when Nfactors is on vector the time segments vector.

Nfactors

Numeric vector. Nfactors: when Nfactors are two vectors, the time segment and the activities pattern then RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and Nfactors is the time segments vector.

fRecrIDX

Numeric vector. fRecrIDX: temp. array for the RecrID vector.

FRecrID

Numeric vector. FRecrID: FRecrID for nRowMatrix is 1 column if the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment (CMATRIX).

Ngroups

Numeric vector. Ngroups is the created vector groupsRecr_at when the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment or the created vector groupsRecr_act_ts when the groupsRecr_at vector and activity pattern are the two factors for the presence absence of the time segment vector.

fbfactX1

Numerical array. fbfactX1: temp. array for the groupsRecr_at vector.

fbfactX2

Numerical array. fbfactX2: temp. array for the activity pattern vector

Fbfact11

Numerical vector. Fbfact11: for the groupsRecr_at vector.

Fbfact22

Numerical vector. Fbfact22: for the activity pattern vector

Value

list00 Nfactors, Fbfact11, Fbfact22, Ngroups, levels_sr, Index_group_number.


NGroup1 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are only once interrupted by their absence (0). Thus in this case we have two groups of ones (presences).

Description

NGroup1(nRowMatrix, activ_segment, c1, c2, sumc1c2, sumc1, levels_sr,Index_group_number, groups, Nfactors, fRecrIDX,FRecrID, Ngroups,fbfactX1, fbfactX2, Fbfact11, Fbfact22, pos1, q).

Usage

NGroup1(
  nRowMatrix,
  activ_segment,
  c1,
  c2,
  sumc1c2,
  sumc1,
  levels_sr,
  Index_group_number,
  groups,
  Nfactors,
  fRecrIDX,
  FRecrID,
  Ngroups,
  fbfactX1,
  fbfactX2,
  Fbfact11,
  Fbfact22,
  pos1,
  q
)

Arguments

nRowMatrix

Matrix. Select each row of the cross table if the vector for the rows matrix equals to one.

activ_segment

Matrix. activ_segment construct of the presence/absence of activities-time segment matrix.

c1

Numeric array. Construct the row of the activities pattern factor in which (sumc_of_groups != 0).

c2

Numeric array. Construct the row of the time segment factor in which (sumc_of_groups != 0).

sumc1c2

Numeric vector The sum per column of the presence/absence per block rows of the activities-and time segment without zeros.

sumc1

Numeric vector. The sum of the activ_segment.

levels_sr

Numeric vector. levels_sr levels of the sum of rows

Index_group_number

Numeric vector. Index_group_number the group number

groups

Numeric vector. Groups: 4 6 7 3 1 16 2 34 25 82 31 41 21 19 15 27 37 67 77 when Nfactors are two vectors, the time segment and the activities pattern and the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and groups: 37 1 4 25 when Nfactors is on vector the time segments vector.

Nfactors

Numeric vector. Nfactors: when Nfactors are two vectors, the time segment and the activities pattern then RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and Nfactors is the time segments vector.

fRecrIDX

Numeric vector. fRecrIDX: temp. array for the RecrID vector.

FRecrID

Numeric vector. FRecrID: FRecrID for nRowMatrix is 1 column if the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment (CMATRIX).

Ngroups

Numeric vector. Ngroups is the created vector groupsRecr_at when the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment or the created vector groupsRecr_act_ts when the groupsRecr_at vector and activity pattern are the two factors for the presence absence of the time segment vector.

fbfactX1

Numerical array. fbfactX1: temp. array for the groupsRecr_at vector.

fbfactX2

Numerical array. fbfactX2: temp. array for the activity pattern vector

Fbfact11

Numerical vector. Fbfact11: for the groupsRecr_at vector.

Fbfact22

Numerical vector. Fbfact22: for the activity pattern vector

pos1

Scalar. Is an index for slicing an array.

q

Scalar. To find out which combination is.

Value

list11 Nfactors, Fbfact11, Fbfact22, Ngroups, levels_sr, Index_group_number.


NGroup2 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are only twice interrupted by their absences (0). Thus in this case we have three groups of ones (presences).

Description

NGroup2(nRowMatrix, activ_segment, c1, c2, sumc1c2, sumc1, levels_sr,Index_group_number, groups, Nfactors, fRecrIDX,FRecrID, Ngroups,fbfactX1, fbfactX2, Fbfact11, Fbfact22, pos1, q).

Usage

NGroup2(
  nRowMatrix,
  activ_segment,
  c1,
  c2,
  sumc1c2,
  sumc1,
  levels_sr,
  Index_group_number,
  groups,
  Nfactors,
  fRecrIDX,
  FRecrID,
  Ngroups,
  fbfactX1,
  fbfactX2,
  Fbfact11,
  Fbfact22,
  pos1,
  q
)

Arguments

nRowMatrix

Matrix. Select each row of the cross table if the vector for the rows matrix equals to one.

activ_segment

Matrix. activ_segment construct of the presence/absence of activities-time segment matrix.

c1

Numeric array. Construct the row of the activities pattern factor in which (sumc_of_groups != 0).

c2

Numeric array. Construct the row of the time segment factor in which (sumc_of_groups != 0).

sumc1c2

Numeric vector The sum per column of the presence/absence per block rows of the activities-and time segment without zeros.

sumc1

Numeric vector. The sum of the activ_segment.

levels_sr

Numeric vector. levels_sr levels of the sum of rows

Index_group_number

Numeric vector. Index_group_number the group number

groups

Numeric vector. Groups: 4 6 7 3 1 16 2 34 25 82 31 41 21 19 15 27 37 67 77 when Nfactors are two vectors, the time segment and the activities pattern and the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and groups: 37 1 4 25 when Nfactors is on vector the time segments vector.

Nfactors

Numeric vector. Nfactors: when Nfactors are two vectors, the time segment and the activities pattern then RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and Nfactors is the time segments vector.

fRecrIDX

Numeric vector. fRecrIDX: temp. array for the RecrID vector.

FRecrID

Numeric vector. FRecrID: FRecrID for nRowMatrix is 1 column if the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment (CMATRIX).

Ngroups

Numeric vector. Ngroups is the created vector groupsRecr_at when the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment or the created vector groupsRecr_act_ts when the groupsRecr_at vector and activity pattern are the two factors for the presence absence of the time segment vector.

fbfactX1

Numerical array. fbfactX1: temp. array for the groupsRecr_at vector.

fbfactX2

Numerical array. fbfactX2: temp. array for the activity pattern vector

Fbfact11

Numerical vector. Fbfact11: for the groupsRecr_at vector.

Fbfact22

Numerical vector. Fbfact22: for the activity pattern vector

pos1

Scalar. Is an index for slicing an array.

q

Scalar. To find out which combination is.

Value

list22 Nfactors, Fbfact11, Fbfact22, Ngroups, levels_sr, Index_group_number.


NGroup3 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are three times interrupted by absences (0). Thus in this case we have four groups of one (presence).

Description

NGroup3(nRowMatrix, activ_segment, c1, c2, sumc1c2, sumc1, levels_sr,Index_group_number, groups, Nfactors, fRecrIDX,FRecrID, Ngroups,fbfactX1, fbfactX2, Fbfact11, Fbfact22, pos1, q).

Usage

NGroup3(
  nRowMatrix,
  activ_segment,
  c1,
  c2,
  sumc1c2,
  sumc1,
  levels_sr,
  Index_group_number,
  groups,
  Nfactors,
  fRecrIDX,
  FRecrID,
  Ngroups,
  fbfactX1,
  fbfactX2,
  Fbfact11,
  Fbfact22,
  pos1,
  q
)

Arguments

nRowMatrix

Matrix. Select each row of the cross table if the vector for the rows matrix equals to one.

activ_segment

Matrix. activ_segment construct of the presence/absence of activities-time segment matrix.

c1

Numeric array. Construct the row of the activities pattern factor in which (sumc_of_groups != 0).

c2

Numeric array. Construct the row of the time segment factor in which (sumc_of_groups != 0).

sumc1c2

Numeric vector The sum per column of the presence/absence per block rows of the activities-and time segment without zeros.

sumc1

Numeric vector. The sum of the activ_segment.

levels_sr

Numeric vector. levels_sr levels of the sum of rows

Index_group_number

Numeric vector. Index_group_number the group number

groups

Numeric vector. Groups: 4 6 7 3 1 16 2 34 25 82 31 41 21 19 15 27 37 67 77 when Nfactors are two vectors, the time segment and the activities pattern and the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and groups: 37 1 4 25 when Nfactors is on vector the time segments vector.

Nfactors

Numeric vector. Nfactors: when Nfactors are two vectors, the time segment and the activities pattern then RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and Nfactors is the time segments vector.

fRecrIDX

Numeric vector. fRecrIDX: temp. array for the RecrID vector.

FRecrID

Numeric vector. FRecrID: FRecrID for nRowMatrix is 1 column if the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment (CMATRIX).

Ngroups

Numeric vector. Ngroups is the created vector groupsRecr_at when the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment or the created vector groupsRecr_act_ts when the groupsRecr_at vector and activity pattern are the two factors for the presence absence of the time segment vector.

fbfactX1

Numerical array. fbfactX1: temp. array for the groupsRecr_at vector.

fbfactX2

Numerical array. fbfactX2: temp. array for the activity pattern vector

Fbfact11

Numerical vector. Fbfact11: for the groupsRecr_at vector.

Fbfact22

Numerical vector. Fbfact22: for the activity pattern vector

pos1

Scalar. Is an index for slicing an array.

q

Scalar. To find out which combination is.

Value

list33 Nfactors, Fbfact11, Fbfact22, Ngroups, levels_sr, Index_group_number.


NGroup4 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are four times interrupted by absences (0). Thus in this case we have five groups of one (presences).

Description

NGroup4(nRowMatrix, activ_segment, c1, c2, sumc1c2, sumc1, levels_sr,Index_group_number, groups, Nfactors, fRecrIDX,FRecrID, Ngroups,fbfactX1, fbfactX2, Fbfact11, Fbfact22, pos1, q).

Usage

NGroup4(
  nRowMatrix,
  activ_segment,
  c1,
  c2,
  sumc1c2,
  sumc1,
  levels_sr,
  Index_group_number,
  groups,
  Nfactors,
  fRecrIDX,
  FRecrID,
  Ngroups,
  fbfactX1,
  fbfactX2,
  Fbfact11,
  Fbfact22,
  pos1,
  q
)

Arguments

nRowMatrix

Matrix. Select each row of the cross table if the vector for the rows matrix equals to one.

activ_segment

Matrix. activ_segment construct of the presence/absence of activities-time segment matrix.

c1

Numeric array. Construct the row of the activities pattern factor in which (sumc_of_groups != 0).

c2

Numeric array. Construct the row of the time segment factor in which (sumc_of_groups != 0).

sumc1c2

Numeric vector The sum per column of the presence/absence per block rows of the activities-and time segment without zeros.

sumc1

Numeric vector. The sum of the activ_segment.

levels_sr

Numeric vector. levels_sr levels of the sum of rows

Index_group_number

Numeric vector. Index_group_number the group number

groups

Numeric vector. Groups: 4 6 7 3 1 16 2 34 25 82 31 41 21 19 15 27 37 67 77 when Nfactors are two vectors, the time segment and the activities pattern and the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and groups: 37 1 4 25 when Nfactors is on vector the time segments vector.

Nfactors

Numeric vector. Nfactors: when Nfactors are two vectors, the time segment and the activities pattern then RecrID is the only factor for the presence absence of the combination of the activities in a given time segment and Nfactors is the time segments vector.

fRecrIDX

Numeric vector. fRecrIDX: temp. array for the RecrID vector.

FRecrID

Numeric vector. FRecrID: FRecrID for nRowMatrix is 1 column if the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment (CMATRIX).

Ngroups

Numeric vector. Ngroups is the created vector groupsRecr_at when the RecrID is the only factor for the presence absence of the combination of the activities in a given time segment or the created vector groupsRecr_act_ts when the groupsRecr_at vector and activity pattern are the two factors for the presence absence of the time segment vector.

fbfactX1

Numerical array. fbfactX1: temp. array for the groupsRecr_at vector.

fbfactX2

Numerical array. fbfactX2: temp. array for the activity pattern vector

Fbfact11

Numerical vector. Fbfact11: for the groupsRecr_at vector.

Fbfact22

Numerical vector. Fbfact22: for the activity pattern vector

pos1

Scalar. Is an index for slicing an array.

q

Scalar. To find out which combination is.

Value

list44 Nfactors, Fbfact11, Fbfact22, Ngroups, levels_sr, Index_group_number.


Run Queries

Description

Run Queries

Usage

Run_Queries(dataset1, conn = NULL)

Arguments

dataset1

List of basic tables

conn

Optional database connection

Value

List of query results


combination function to obtain at random c3 matrices

Description

'combinations()' function to obtain at random c3 matrices for the construction of the vector timeMax depending on the number of groupsRecr_act_ts levels

Usage

combinations(groupsRecr_act_ts_levels)

Arguments

groupsRecr_act_ts_levels

Numeric vector.

Value

list50 A list which contains a c3 matrix.


crosstab function. 'crosstab function' Function to compute the group numbers of recreation area with the same activities on the same time segments or to compute the column createused for the group numbers of recreation areas and the activities pattern on the same time segment.

Description

crosstab(Rmatrix, Cmatrix, C1)

Usage

crosstab(Rmatrix, Cmatrix, C1)

Arguments

Rmatrix

Matrix of 1 or 2 columns: The first column contains the vector RcrID or the vector groupsRecr_at and the second column if exist the vextor of the corresponding activities pattern for the vector groupsRecr_at

Cmatrix

Matrix of 2 or 1 coloumn(s) Activities patern ID and time segment for 2 columns or time segment for one column.

C1

matrix empty,vector

If the third argument of the function C1 is an empty matrix and when the Rmatrix matrix contains 1 column THEN the results of this function are the group numbers of recreation areas with the same activities and on the same time segments. If the Rmatrix matrix contains 2 columns then the results of this function are the group numbers of groupsRecr_at and the activities pattern on the same time segment (see Wageningen_tables_Excel folder: Procedures_ACRER.xls, Excel sheet: crosstab_procedure (1 or 9) or HTML folder: Procedures_ACRER.html (crosstab_procedure (1 or 9) section) If the third argument of the function C1 matrix is NOT an empty matrix but contains the linear optimization solution of our model THEN the result of this function are the linear optimization solutions per time segment.

Details

The data we use here are from the table data which we got from a query from a query of the Final table. The table data had n records (n rows = 970) and 4 columns namely: recreation area, activities pattern, transport type and time segment. This table data with the use of the function group_by was reduced in n1=515 records. The column of the trasport type is not important for the groups computation The crosstab function has 5 subfunctions: 1. NGroup0 2. NGroup1 3. NGroup2 4. NGroup3 5. NGroup4

NGroup0 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are not interrupted by absence (0). Thus in this case we have one group of ones (presence). NGroup1 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are once interrupted by absence (0). Thus in this case we have two groups of ones (presence). NGroup2 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are twice interrupted by absences (0). Thus in this case we have three groups of ones (presence). NGroup3 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are three times interrupted by absences (0). Thus in this case we have four groups of ones (presence). NGroup4 computes the group numbers of recreation areas where all the sequence(s) of their presences (1) on the combination of activities pattern and time segment are four times interrupted by absences (0). Thus in this case we have five groups of ones (presence)

Value

list1 Listrow_matrix, col_matrix, crosstable, groups_matrix, fdata, tdata.


function to compute the expected visit duration per recreation area.

Description

function to compute via integration the expected visit duration per recreation area.

Usage

expected_visit_duration(
  dMinDurationAbs,
  dMaxDurationAbs,
  dMinDuration,
  dMaxDuration
)

Arguments

dMinDurationAbs

This is equal to_spend_minimum_time_per_activity (in min).

dMaxDurationAbs

This is equal to_spend_maximum_time_per_activity (in min).

dMinDuration

This is equal to max(maxduration,min_duration_abs) (in min).

dMaxDuration

This is equal to min(available_time_for_activity,step1) (in min).

Details

expected_visit_duration(dMinDurationAbs, dMaxDurationAbs, dMinDuration,dMaxDuration).

Value

expected_visit_duration Computation of the expected visit duration: list1a = matrix(dResult).


Generate a Pivot Table by Recreation Area and Zip Code

Description

Generates a pivot table summarizing recreation areas and transport types as rows and zip codes as columns.

Usage

generate_pivot(my_data)

Arguments

my_data

A data frame containing recreation model results (e.g. 13 variables including recreation areas, transport types, zip codes, distances, fuel costs, activity costs, visits, and expected visiting duration).

Value

An object of class PivotTable (PivotTable) containing summary statistics (counts of household groups, mean distances, mean fuel costs, mean activity costs, sum and mean of visits, and sum and mean of expected visiting duration) structured across recreation areas, transport modes, and zip codes.


Generate Percentage of Expected Visiting Duration per Recreation Area

Description

Generates a pivot table calculating the percentage of the row total expected visiting duration per recreation area across zip codes and transport types.

Usage

percent_EVD_Recr(my_data)

Arguments

my_data

A data frame containing recreation model results (e.g. 13 variables including recreation areas, transport types, zip codes, and expected visiting duration).

Value

An object of class PivotTable (PivotTable) containing the calculated percentages of expected visiting duration per recreation area, allowing comparison of destination area shares across zip codes and transport modes.


Generate Percentage of Expected Visiting Duration per Zip Code

Description

Generates a pivot table calculating the percentage of the row total expected visiting duration per zip code across recreation areas and transport types.

Usage

percent_EVD_zip_code(my_data)

Arguments

my_data

A data frame containing recreation model results (e.g. 13 variables including recreation areas, transport types, zip codes, and expected visiting duration).

Value

An object of class PivotTable (PivotTable) containing the calculated percentages of expected visiting duration per zip code, allowing identification of origin areas with the highest duration shares.


Generate Percentage of Grand Total Expected Visiting Duration

Description

Generates a pivot table calculating the percentage of the Grand Total expected visiting duration across all recreation areas, transport types, and zip codes.

Usage

percent_GT_EVD_pivot(my_data)

Arguments

my_data

A data frame containing recreation model results (e.g. 13 variables including recreation areas, transport types, zip codes, and expected visiting duration).

Value

An object of class PivotTable (PivotTable) containing the Grand Total percentages of expected visiting duration across recreation areas, transport types, and zip codes.


Generate Percentage of Grand Total Number of Visits

Description

Generates a pivot table calculating the percentage of the Grand Total number of visits across all recreation areas, transport types, and zip codes.

Usage

percent_GT_NV_pivot(my_data)

Arguments

my_data

A data frame containing recreation model results (e.g. 13 variables including recreation areas, transport types, zip codes, and number of visits).

Value

An object of class PivotTable (PivotTable) containing the Grand Total percentages of visits across recreation areas, transport types, and zip codes.


Generate Percentage of Number of Visits per Recreation Area

Description

Generates a pivot table calculating the percentage of the row total number of visits per recreation area across zip codes and transport types.

Usage

percent_NV_Recr(my_data)

Arguments

my_data

A data frame containing recreation model results (e.g. 13 variables including recreation areas, transport types, zip codes, and number of visits).

Value

An object of class PivotTable (PivotTable) containing the calculated percentages of visits per recreation area across zip codes and transport types.


Generate Percentage of Number of Visits per Zip Code

Description

Generates a pivot table calculating the percentage of the row total number of visits per zip code across recreation areas and transport types.

Usage

percent_NV_zip_code(my_data)

Arguments

my_data

A data frame containing recreation model results (e.g. 13 variables including recreation areas, transport types, zip codes, and number of visits).

Value

An object of class PivotTable (PivotTable) containing the calculated percentages of visits per zip code across recreation areas and transport types.


Model ACRER (Wageningen_SQLite_2023) Main function for the model ACRER.

Description

The model ACRER is a recreation model and simulates the number of persons per household and group types, the expected visiting duration as well as the number of visits from a zip code in a city to the destination area.

Usage

run_Acrer_model(
  db_choice = 1,
  output_dir = NULL,
  interactive_ui = FALSE,
  db_path = NULL
)

Arguments

db_choice

Integer or character. 1 or "basic" for Basic tables, 2 or "complete" for Wageningen complete tables. Default is 1.

output_dir

Character. Optional directory path to save outputs. Default NULL uses inst/extdata or tempdir.

interactive_ui

Logical. If TRUE and in interactive session, prompts user with GUI dialogs. Default FALSE.

db_path

Optional character. Direct file or directory path to SQLite DB file. Default NULL.

Value

A list containing model results and pivot data frame.


Open a connection to the Wageningen SQLite DB

Description

Connects to a local SQLite DB file. If the file is not found locally, it is downloaded from the published Zenodo open-access repository (record 22671742) and stored in a persistent user cache directory.

Usage

wageningen_conn(db_choice = 1, db_path = NULL, force_download = FALSE)

Arguments

db_choice

Integer or character: 1 or "basic" for Basic tables, 2 or "complete" for Wageningen complete tables. Default is 1.

db_path

Optional character. Direct file path or directory containing the SQLite DB file.

force_download

Logical. If TRUE, re-downloads the database even if cached. Default is FALSE.

Value

A DBI SQLite connection. Remember to close it with 'DBI::dbDisconnect()' when you are done.

Examples

## Not run: 
conn <- ACRER::wageningen_conn()
DBI::dbListTables(conn)
DBI::dbDisconnect(conn)

## End(Not run)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.