Format a crestObj
with private data.
A dataframe containing the presence records of the studied proxies and their associated climate values.
A vector of the climate variables to extract. See
accClimateVariables
for the list of accepted values.
A data frame containing the data to reconstruct (counts, percentages or presence/absence data).
A dataframe of climate values across the study area
useful to correct for the imbalance of the sampling data (see
'crest.calibrate
for more details). Default is NA
.
The records in the distributions can be weighted using the
percentages by setting weight=TRUE. Include a column called 'weight'
in the distributions
table.
The minimum number of unique presence data necessary to estimate a species' climate response. Default is 20.
A data frame assigns which taxa should be used for each variable (1 if the taxon should be used, 0 otherwise). The colnames should be the climate variables' names and the rownames the taxa names. Default is 1 for all taxa and all variables.
A vector containing the coordinates of the study site.
Default c(NA, NA)
.
The name of the dataset (default NA
).
The climate values at the location of the dataset
'(default NA
).
A boolean to print non-essential comments on the terminal
(default TRUE
).
A crestObj
object containing the spatial distributions.
#> Reformating the example dataset to fit this function
distributions <- cbind('ProxyName'= rep('Taxon1', nrow(reconstr$modelling$distributions[[1]])),
reconstr$modelling$distributions[[1]],
stringsAsFactors = FALSE)
for(tax in names(reconstr$modelling$distributions)[-1]) {
distributions <- rbind(distributions,
cbind('ProxyName'= rep(tax, nrow(reconstr$modelling$distributions[[tax]])),
reconstr$modelling$distributions[[tax]],
stringsAsFactors = FALSE)
)
}
distributions <- distributions[, c(2,1,3:6)]
print(head(distributions))
#> taxonid ProxyName longitude latitude bio1 bio12
#> 1 1 Taxon1 12.75 1.75 23.8 277
#> 2 1 Taxon1 11.75 2.75 23.7 172
#> 3 1 Taxon1 13.75 2.75 24.0 93
#> 4 1 Taxon1 14.25 3.75 25.6 203
#> 5 1 Taxon1 14.75 4.25 26.4 171
#> 6 1 Taxon1 11.25 4.75 22.5 281
climate_space <- reconstr$modelling$climate_space
print(head(climate_space))
#> longitude latitude bio1 bio12
#> 1 0.25 0.25 15.4 3
#> 2 0.25 0.75 15.1 38
#> 3 0.25 1.25 18.2 37
#> 4 0.25 1.75 13.6 137
#> 5 0.25 2.25 15.5 178
#> 6 0.25 2.75 13.4 325
x <- crest.set_modern_data(distributions, df=crest_ex,
climate = c("bio1", "bio12"))
#>
#> ## Prepping data for database extraction
#> <> Checking parameters ................... [OK]
#> <> Checking/Defining selectedTaxa ........
#> Warning: One or more taxa were are not in the distribution table and have been ignored. Check 'x$misc$taxa_notes' for details.
#> [OK]
#> <> Checking the list of taxa ............. [OK]
#> <> Creating the crestObj ................. [OK]
#> <> Inserting the fossil data ............. [OK]
#> <> Formatting the modern distributions ... [OK]
#> <> Checking the climate space ............ [OK]
#> ## Data insertion completed.
#>
x <- crest.set_modern_data(distributions, df=crest_ex,
climate_space=climate_space,
climate = c("bio1", "bio12"))
#>
#> ## Prepping data for database extraction
#> <> Checking parameters ................... [OK]
#> <> Checking/Defining selectedTaxa ........
#> Warning: One or more taxa were are not in the distribution table and have been ignored. Check 'x$misc$taxa_notes' for details.
#> [OK]
#> <> Checking the list of taxa ............. [OK]
#> <> Creating the crestObj ................. [OK]
#> <> Inserting the fossil data ............. [OK]
#> <> Formatting the modern distributions ... [OK]
#> <> Checking the climate space ............ [OK]
#> ## Data insertion completed.
#>