wrap_long: Wrapper for long data (tidy) for a variety of functions

Description Usage Arguments

View source: R/long_wrapper.R

Description

Takes input in long data format and applies the compost-package function listed in 'fun'. Outputs long format data as well.

Usage

1
2
wrap_long(fun, args = NULL, int_df = NULL, rca_df = NULL,
  sim_df = NULL)

Arguments

fun

selects the function to apply to the input data. Possible values are: 'get_rca', 'get_similarity'

args

list with arguments to the function listed in fun. Possible arguments depends on the function.

'get_rca':

- 'binary' (logical) decides whether RCA values are binarized. Possible values are 'TRUE' or 'FALSE'.

'get_similarity':

- 'method' (string) selects equation to use for similarity calculations. Possible values are 'jaccard', 'association', or 'proximity'

'get_average_sim':

- 'exclude0' (logical) decides if 0s should be excluded (as NA values) when taking average_sim. Possible values are 'TRUE' or 'FALSE'

'get_density':

- 'binary' (logical) decides if it is allowed for RCA matrix to be non-binary. If 'FALSE' RCA values (non binary) can act as weights for similarity values.

Note: 'get_closest_sim', and 'get_weighted_average_sim' does not have any additional arguments.

int_df

data frame that contains four variables: time, region, unit, intensity. Default is NULL.

rca_df

data frame that contains four variables: time, region, unit, rca. Default is NULL.

sim_df

data frame that contains four variables: time, from_unit, to_unit, similarity. Default is NULL.


sbpdata/compost documentation built on Nov. 5, 2019, 6:17 a.m.