knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(crestr) #attach(crest_ex_pse) PSE <-rbind( c(1, 'Ericaceae', NA, NA, 'Ericaceae'), c(2, 'Asteraceae', 'Artemisia', NA, 'Artemisia'), c(2, 'Oleaceae', 'Olea', NA, 'Olea') ) colnames(PSE) <- colnames(crest_ex_pse) rownames(PSE) <- 1:3 PSE <- as.data.frame(PSE) #cbind(as.factor(c(1,2,2)), c('Ericaceae', 'Asteraceae', 'Oleaceae'))
There are two ways to access and use the gbif4crest calibration dataset, which are illustrated here with a simple PSE file.
PSE
The first option consists in using the default option: connecting to the online gbif4crest. This is the simplest option and users only have to provide the name of the database to the field dbname = "gbif4crest_02"
.
reconstr <- crest.get_modern_data( pse = PSE, taxaType = 1, climate = c("bio1", "bio12"), # The name of the online database to extract the data from dbname = "gbif4crest_02", verbose = FALSE ) if(is.crestObj(reconstr)) tapply(reconstr$modelling$taxonID2proxy[,1], reconstr$modelling$taxonID2proxy[,2], length)
This option is usually much faster but it requires downloading the full database in a zipped format from [here]{target="_blank"}. Once unzipped, the file, which is about ~23Gb, should be saved in a location of interest.
reconstr <- crest.set_modern_data( pse = PSE, taxaType = 1, climate = c("bio1", "bio12"), # The full path to the local gbif4crest database dbname = "path/to/gbif4crest_02.sqlite3", verbose = FALSE )
The file can be saved anywhere and named in any way. However. the inclusion of the file extension '.sqlite3' is key for the package to be guided to the right option.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.