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.625 1.625 23.8 277
#> 2 1 Taxon1 11.625 2.625 23.7 172
#> 3 1 Taxon1 13.625 2.625 24.0 93
#> 4 1 Taxon1 14.125 3.625 25.6 203
#> 5 1 Taxon1 14.625 4.125 26.4 171
#> 6 1 Taxon1 11.125 4.625 22.5 281
climate_space <- reconstr$modelling$climate_space
print(head(climate_space))
#> longitude latitude bio1 bio12
#> 1 0.125 0.125 15.4 3
#> 2 0.125 0.625 15.1 38
#> 3 0.125 1.125 18.2 37
#> 4 0.125 1.625 13.6 137
#> 5 0.125 2.125 15.5 178
#> 6 0.125 2.625 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.
#>