Computes ecological memory patterns on simulated pollen curves produced by the virtualPollen package.
runExperiment.RdApplies computeMemory to assess ecological memory on a large set of virtual pollen curves.
Usage
runExperiment(
simulations.file = NULL,
selected.rows = NULL,
selected.columns = NULL,
parameters.file = NULL,
parameters.names = NULL,
driver.column = NULL,
response.column = "Pollen",
subset.response = "none",
time.column = "Time",
time.zoom = NULL,
lags = NULL,
repetitions = 10
)Arguments
- simulations.file
List of dataframes produced by
virtualPollen::simulatePopulation. Each list element is a time series dataframe for one virtual taxon. Can be a 1D list (one sampling scheme) or a 2D matrix-like list (rows = taxa, columns = sampling schemes). SeevirtualPollen::simulationfor an example. Default:NULL.- selected.rows
Numeric vector indicating which virtual taxa (list elements) from
simulations.fileto analyze. For example,c(1, 3)analyzes the 1st and 3rd taxa. Default:NULL(analyzes all taxa).- selected.columns
Numeric vector indicating which sampling schemes (columns) from
simulations.fileto analyze. Only relevant whensimulations.filehas a 2D structure with multiple sampling schemes. Default:NULL(uses the first sampling scheme only).- parameters.file
Dataframe of simulation parameters produced by
virtualPollen::parametersDataframe, with one row per virtual taxon. Rows must align withsimulations.file. SeevirtualPollen::parametersfor an example. Default:NULL.- parameters.names
Character vector of column names from
parameters.fileto include in output labels. These help identify which simulation settings produced each result. Example:c("maximum.age", "fecundity"). Default:NULL.- driver.column
Character vector of column names representing environmental drivers in the simulation dataframes. Common choices:
"Driver.A","Driver.B", or"Suitability". Default:NULL.- response.column
Character string naming the response variable column in the simulation dataframes. Use
"Pollen"for pollen abundance fromvirtualPollen::simulation. Default:"Pollen".- subset.response
character string, one of "up", "down" or "none", triggers the subsetting of the input dataset. "up" only models ecological memory on cases where the response's trend is positive, "down" selects cases with negative trends, and "none" selects all cases. Default:
"none".- time.column
character string, name of the time/age column. Usually, "Time". Default:
"Time".- time.zoom
numeric vector with two numbers defining the time/age extremes of the time interval of interest. Default:
NULL.- lags
numeric vector, lags to be used in the equation, in the same units as
time. The use ofseqto define it is highly recommended. If 0 is absent from lags, it is added automatically to allow the consideration of a concurrent effect. Lags should be aligned to the temporal resolution of the data. For example, if the interval between consecutive samples is 100 years, lags should be something like0, 100, 200, 300. Lags can also be multiples of the time resolution, such as0, 200, 400, 600(when time resolution is 100 years). Default:NULL.- repetitions
integer, number of random forest models to fit. Default:
10.
Value
A list with 2 slots:
namesmatrix of character strings, with as many rows and columns assimulations.file. Each cell holds a simulation name to be used afterwards, when plotting the results of the ecological memory analysis.outputa list with as many rows and columns assimulations.file. Each slot holds a an output ofcomputeMemory.memorydataframe with five columns:Variablecharacter, names and lags of the different variables used to model ecological memory.mediannumeric, median importance acrossrepetitionsof the givenVariableaccording to Random Forest.sdnumeric, standard deviation of the importance values of the givenVariableacrossrepetitions.minandmaxnumeric, percentiles 0.05 and 0.95 of importance values of the givenVariableacrossrepetitions.
R2vector, values of pseudo R-squared value obtained for the Random Forest model fitted on each repetition. Pseudo R-squared is the Pearson correlation between the observed and predicted data.predictiondataframe, with the same columns as the dataframe in the slotmemory, with the median and confidence intervals of the predictions of all random forest models fitted.multicollinearitymulticollinearity analysis on the input data performed withvif_df. A vif value higher than 5 indicates that the given variable is highly correlated with other variables.
See also
Other virtualPollen:
experimentToTable(),
plotExperiment()