View source: R/data_handling.R
| conv_l_yr | R Documentation | 
conv_l_yr converts the first element of the output from collate_yr
(census) in long format. This can be then fed into downstream analysis
(e.g. fit_regression)
conv_l_yr( data, npops_noMeta = 1, appendMeta = FALSE, project, scenario, yrs = c(1, 2), save2disk = TRUE, dir_out = "ProcessedData" )
| data | The df 'census' from  | 
| npops_noMeta | The total number of populations excluding the metapopulation, default: 1 | 
| appendMeta | Whether to calculate data for the metapopulation, default: FALSE | 
| project | Vortex project name (used to name the output) | 
| scenario | Vortex scenario name (used to name the output) | 
| yrs | The year(s) that need to be retained in the output | 
| save2disk | Whether to save the data as rda and csv, default: TRUE | 
| dir_out | The local path to store the output. Default: ProcessedData | 
yrs is used to indicate the years to be retained in the output. If more
than one year is required, these may be requested defining a numeric vector,
e.g. yrs=c(10, 20, 30). All simulated years can be included in the output by
passing a numeric vector with all years. For example, assuming that 100 years
were simulated, using yrs=1:100 would retain all 100 years in the
output.
dir_out is created within the working directory unless a full path is
provided.
The census data.frame in long format
# Using Pacioni et al. example data. See ?pac.yr for more details. data(pac.yr) lyr.classic <- conv_l_yr(pac.yr[[1]] , yrs=c(60, 120), save2disk=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.