courtiol / IsoriX

This is the GitHub repository dedicated to the development of the R package IsoriX
13 stars 6 forks source link

Expand the getXXX() family #153

Open courtiol opened 2 years ago

courtiol commented 2 years ago

Goal

We need multiple getXXX() functions to retrieve data used in IsoriX. Like the new iteration of getelev() these functions should ideally be interfaces to other R packages, so that the maintenance and updating of the source data is externalized.

Adding elevatr -- the package used in getelev() in Imports was a mistake since this package has many indirect dependencies. The same is likely to be true of other packages used to import data. Instead, those packages should only be suggested and their presence should be checked when one is using the relevant getXXX() function.

I would rather to have user facing getXXX() functions which refer to type of data rather than to where the data come from. Hence, no getCRUCL() but rather getprecip(), gettemp() and so forth. Behind the scene, we could have (non-exported) functions that refer to packages if that helps. If for some type of data, several sources are possible, this should be handled via an argument.

Needs

It is not very clear what is needed but I can think of this at the moment: elevation, bathymetry, temperature, humidity, precipitation, wetness index (see #149), calibration datasets, isotopes. I guess the list will keep growing but these functions can be added on need basis and not all at once.

Data sources and comments

Elevation and bathymetry

Already done using elevatr but the 2 should be distinguished in distinct functions and the replacement of values could be done at this stage rather than in prepraster() (with impact on #152).

Climatic data

The R package getCRUCLdata contains:

The data behind this package are described in this paper. One limitation is that those data are split per month but not per year and thus correspond to averages over many years. Another is that data seem to span 1960 to 1990, nothing more recent.

There is also NicheMapR and microclima that can be connected to produce rasters as discussed here.

Precipitation

@stephkramer noted that worldclim should be replaced with chelsa data. But this would need to be compared to the CRUCL data mentioned above.

Wetness index

A participant of the summer school remarked: "for predicting carbon isotopes from vegetation it would be cool to include a hydrological model (e.g. wetness index based on river flow & catchment)." I know nothing about this topic.

Calibration datasets

We should probably use those provided in assignR. Keith told me to take his data from there.

Isotopes

Perhaps we could use Gabe's API to download the isotopic data within R: https://github.com/SPATIAL-Lab/wiDButil A lot of data seem to be proprietary and have value 9999 but perhaps a lot is still useful for our purposes. Here is an example of a website using the API: https://waterisotopesdb.org/

Hopefully ISObank will one day have an API which we will be able to tap into.

Note: this issue extends and thus replaces #46, #85, #106, #129, #149,

courtiol commented 10 months ago

If you do think this issue matters to you, please add a thumb up!

courtiol commented 3 weeks ago

Note: for calibration datasets, I could also contact Jackson Kusack. Keith greenlighted this on 11 Sept 2024, 10:51.

courtiol commented 3 weeks ago

Note: a student of the summer school mentioned that it would be great to add saturated vapor pressure.

courtiol commented 3 weeks ago

Note: for ocean isoscapes, the distance to the shore should be available. See also: https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.13138 for other covariates.