Title: | Tools and Data for the International Soil Radiocarbon Database |
---|---|
Description: | This is the central location for data and tools for the development, maintenance, analysis, and deployment of the International Soil Radiocarbon Database (ISRaD). ISRaD was developed as a collaboration between the U.S. Geological Survey Powell Center and the Max Planck Institute for Biogeochemistry. This R package provides tools for accessing and manipulating ISRaD data, compiling local data using the ISRaD data structure, and simple query and reporting functions for ISRaD. For more detailed information visit the ISRaD website at: <https://soilradiocarbon.org/>. |
Authors: | Alison Hoyt [aut], Jeffrey Beem-Miller [aut, cre], Shane Stoner [aut], J. Grey Monroe [aut], Caitlin Hicks-Pries [aut], Paul A. Levine [aut] |
Maintainer: | Jeffrey Beem-Miller <[email protected]> |
License: | GPL-2 |
Version: | 2.5.5 |
Built: | 2024-12-14 06:54:23 UTC |
Source: | CRAN |
Check that the template information file and the template file match appropriately.
checkTemplateFiles(outfile = "", verbose = TRUE)
checkTemplateFiles(outfile = "", verbose = TRUE)
outfile |
file to dump the output report. Defaults to an empty string that will print to standard output |
verbose |
if TRUE (default) will print output to specified outfile |
Used in compile() function, but primarily a development tool
Nothing (run for side effects).
checkTemplateFiles()
checkTemplateFiles()
Compiles template files into ISRaD database format.
compile( dataset_directory, write_report = FALSE, write_out = FALSE, return_type = c("none", "list")[2], checkdoi = FALSE, verbose = TRUE )
compile( dataset_directory, write_report = FALSE, write_out = FALSE, return_type = c("none", "list")[2], checkdoi = FALSE, verbose = TRUE )
dataset_directory |
Directory where completed QAQCed template files are stored. |
write_report |
Boolean flag to write a log file of the compilation. File will be in the specified dataset_directory at "database/ISRaD_log.txt". If a file with this name already exists in this directory it will be overwritten. |
write_out |
Set to TRUE to write the compiled database file in .xlsx format in dataset_directory |
return_type |
A string that defines return object. Acceptable values are "none" or "list"; default is "list". |
checkdoi |
Set to FALSE if you do not want to validate DOIs during QAQC. (Warning: time consuming). |
verbose |
Set to TRUE to print results of function to console. |
# Load example dataset Gaudinski_2001 entry <- ISRaD::Gaudinski_2001 # Save as .xlsx file ISRaD.save.entry( entry = entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile = file.path(tempdir(), "Gaudinski_2001.xlsx") ) # Compile .xlsx file/s in dataset_directory into ISRaD database object ISRaD.compiled <- compile(tempdir(), write_report = TRUE, write_out = TRUE, return_type = "list", checkdoi = FALSE, verbose = TRUE )
# Load example dataset Gaudinski_2001 entry <- ISRaD::Gaudinski_2001 # Save as .xlsx file ISRaD.save.entry( entry = entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile = file.path(tempdir(), "Gaudinski_2001.xlsx") ) # Compile .xlsx file/s in dataset_directory into ISRaD database object ISRaD.compiled <- compile(tempdir(), write_report = TRUE, write_out = TRUE, return_type = "list", checkdoi = FALSE, verbose = TRUE )
convert fraction modern to d14c and d14c to fraction modern
convert_fm_d14c(fm = NA, d14c = NA, obs_date_y, verbose = TRUE)
convert_fm_d14c(fm = NA, d14c = NA, obs_date_y, verbose = TRUE)
fm |
fraction modern |
d14c |
delta 14c in per mille |
obs_date_y |
year of observation/sample collection |
verbose |
prints message stating which conversion was performed |
Convenience function for radiocarbon unit conversions. Recommended to set verbose = FALSE for batch conversions.
J. Beem-Miller
convert_fm_d14c(fm = 0.97057, obs_date_y = 2005) convert_fm_d14c(d14c = -35.86611, obs_date_y = 2005)
convert_fm_d14c(fm = 0.97057, obs_date_y = 2005) convert_fm_d14c(d14c = -35.86611, obs_date_y = 2005)
Predicted atmospheric 14C data for 2020-2025.
data(future14C)
data(future14C)
dataframe
Future atmospheric 14C predictions for the period 2020 to 2025 are projected using a time series model trained on data covering the period 2000-2019. See Sierra (2018) for model details.
Sierra, C. "Forecasting atmospheric radiocarbon decline to pre-bomb values", Radiocarbon, Vol 60, Nr 4, 2018, p 1055.1066 DOI:10.1017/RDC.2018.33
Gaudinski_2001 data set
data(Gaudinski_2001)
data(Gaudinski_2001)
list
Example of an ISRaD entry. Selected as an example dataset as it contains data in all 8 tables of the ISRaD data structure: metadata, site, profile, flux, layer, interstitial, fraction, incubation.
Gaudinski, J., 2001, Belowground carbon cycling in three temperate forests of the eastern United States, University of California Irvine, Ph.D. thesis
Atmospheric 14C and 13C data for the period 1850-2016.
data(Graven_2017)
data(Graven_2017)
dataframe
Data from Graven et al., 2017. Annual timestep. Three zones for 14C: 1) northern hemisphere, "NHc14" > 30 deg N, 2) southern hemisphere, "SHc14" > 30 deg S, 3) tropics, "Tropicsc14" < 30 deg N & < 30 deg S. 13C data are the global annual averages.
Graven, H., Allison, C. E., Etheridge, D. M., Hammer, S., Keeling, R. F., Levin, I., Meijer, H. A. J., Rubino, M., Tans, P. P., Trudinger, C. M., Vaughn, B. H., and White, J. W. C.: Compiled records of carbon isotopes in atmospheric CO2 for historical simulations in CMIP6, Geosci. Model Dev., 10, 4405–4417, https://doi.org/10.5194/gmd-10-4405-2017, 2017.
Atmospheric 14C data for the period 1941-2019.
data(Hua_2021)
data(Hua_2021)
dataframe
Data from Hua et al., 2021. Original dataset had subannual resolution and five atmospheric zones: three in the northern hemisphere, two in the southern hemisphere (cf. Fig. 1, Hua et al., 2021). Data here are smoothed to annual means and averaged across the northern and southern hemispheres, yielding two atmopsheric zones: 1) northern hemisphere, "NH14C" > 0 deg N, 2) southern hemisphere, "SH14C" > 0 deg S. Original data available in supplemental table 2 of Hua et al. (2021), or from the SoilR package as object 'Hua2021' (note the data object has a different name in this package to prevent data masking).
Hua, Q., Turnbull, J., Santos, G., Rakowski, A., Ancapichún, S., De Pol-Holz, R., . . . Turney, C. (2022). ATMOSPHERIC RADIOCARBON FOR THE PERIOD 1950–2019. Radiocarbon, 64(4), 723-745. doi:10.1017/RDC.2021.95
Fills transformed and geospatial data where possible to generate an enhanced version of ISRaD.
ISRaD.extra(database, geodata_directory)
ISRaD.extra(database, geodata_directory)
database |
ISRaD dataset object |
geodata_directory |
directory where geospatial data are found |
Fills fraction modern, delta 14C, delta-delta, profile coordinates, bulk density, organic C concentration, and SOC stocks from entered data; fills soil and climatic data from external geospatial data products
New ISRaD_extra object with derived, transformed, and filled columns.
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill ISRaD.extra data database.x <- ISRaD.extra(database, geodata_directory = system.file("extdata", "geodata_directory", package = "ISRaD") )
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill ISRaD.extra data database.x <- ISRaD.extra(database, geodata_directory = system.file("extdata", "geodata_directory", package = "ISRaD") )
Calculates atmospheric 14c in the year of sampling for each record in an ISRaD object
ISRaD.extra.calc_atm14c(database, future = TRUE)
ISRaD.extra.calc_atm14c(database, future = TRUE)
database |
ISRaD object |
future |
Project atmospheric radiocarbon into the future? |
Creates new column for atmospheric 14c (xxx_atm14c). Observation year and profile coordinates must be filled (use ISRaD.extra.fill_dates, and ISRaD.extra.fill_coords functions). The relevant atmospheric 14C data (northern or southern hemisphere) are determined by profile coordinates.
Atmospheric zones are limited to the northern or southern hemisphere, as differences in 14C in the source data (Hua et al., 2021) within either the northern or southern hemisphere are essentially zero after ~1980, and this is the period over which the majority of data in ISRaD were collected.
Future atmospheric 14C predictions for the period 2020 to 2025 are projected using a time series model trained on data covering the period 2000-2019 (cf. Sierra, 2018).
ISRaD_data object with new atmospheric zone and atmospheric 14C columns in relevant tables.
J. Beem-Miller and C. Hicks-Pries
Hua, Q., Turnbull, J., Santos, G., Rakowski, A., Ancapichún, S., De Pol-Holz, R., . . . Turney, C. (2022). ATMOSPHERIC RADIOCARBON FOR THE PERIOD 1950–2019. Radiocarbon, 64(4), 723-745. doi:10.1017/RDC.2021.95
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database) # Fill dates database.x <- ISRaD.extra.fill_dates(database.x) # Fill delta 14C from fraction modern database.x <- ISRaD.extra.fill_rc(database.x) # Fill atmospheric 14c database.x <- ISRaD.extra.calc_atm14c(database.x)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database) # Fill dates database.x <- ISRaD.extra.fill_dates(database.x) # Fill delta 14C from fraction modern database.x <- ISRaD.extra.fill_rc(database.x) # Fill atmospheric 14c database.x <- ISRaD.extra.calc_atm14c(database.x)
Calculates soil organic carbon stock
ISRaD.extra.Cstocks(database)
ISRaD.extra.Cstocks(database)
database |
ISRaD dataset object. |
Function first fills lyr_bd_samp, lyr_c_org, lyr_c_org, lyr_coarse_tot. Notes:
1) SOC stocks can only be calculated if organic carbon concentration and bulk density data are available
2) SOC stocks are calculated for the fine earth fraction (<2mm).
ISRaD_data object with filled columns "lyr_coarse_tot_filled", "lyr_bd_samp_filled", "lyr_c_inorg_filled", "lyr_c_org_filled", "lyr_soc_filled".
J. Beem-Miller
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 database.x <- ISRaD.extra.Cstocks(database)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 database.x <- ISRaD.extra.Cstocks(database)
Calculates the difference between sample delta 14c and the atmosphere for the year of collection (delta-delta)
ISRaD.extra.delta_delta(database)
ISRaD.extra.delta_delta(database)
database |
ISRaD dataset object |
Creates new column for delta-delta value. Function "ISRaD.extra.calc_atm14c" should be run first.
ISRaD_data object with new delta-delta columns in relevant tables.
J. Beem-Miller
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database) # Fill dates database.x <- ISRaD.extra.fill_dates(database.x) # Fill delta 14C from fraction modern database.x <- ISRaD.extra.fill_rc(database.x) # Fill atmospheric 14c database.x <- ISRaD.extra.calc_atm14c(database.x) # Fill delta delta database.x <- ISRaD.extra.delta_delta(database.x)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database) # Fill dates database.x <- ISRaD.extra.fill_dates(database.x) # Fill delta 14C from fraction modern database.x <- ISRaD.extra.fill_rc(database.x) # Fill atmospheric 14c database.x <- ISRaD.extra.calc_atm14c(database.x) # Fill delta delta database.x <- ISRaD.extra.delta_delta(database.x)
Calculates missing C:N ratios for records with reported C and N data
ISRaD.extra.fill_CN(database)
ISRaD.extra.fill_CN(database)
database |
ISRaD dataset object |
When possible, missing C:N ratios are calculated for records in the layer and fraction tables using reported values for organic C and total N. Variable "lyr_c_org_filled" must exist for function to work on layer table data. If you are running the function on a standard ISRaD database object (i.e. NOT ISRaD_extra) it is recommended to run the function "ISRaD.extra.Cstocks" first in order to create and fill the required "lyr_c_org_filled" column.
ISRaD database object with gap-filled C:N data in new column ""
Shane Stoner & J. Beem-Miller
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Create lyr_c_org_filled column database.x <- ISRaD.extra.Cstocks(database) # Fill CN data database.x <- ISRaD.extra.fill_CN(database.x)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Create lyr_c_org_filled column database.x <- ISRaD.extra.Cstocks(database) # Fill CN data database.x <- ISRaD.extra.fill_CN(database.x)
Fills profile coordinates from site coordinates if profile coordinates not reported.
ISRaD.extra.fill_coords(database)
ISRaD.extra.fill_coords(database)
database |
ISRaD dataset object. |
ISRaD_data object with filled profile coordinates.
J. Beem-Miller
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database)
Fills country code from profile coordinates
ISRaD.extra.fill_country(database, continent = FALSE, region = FALSE)
ISRaD.extra.fill_country(database, continent = FALSE, region = FALSE)
database |
ISRaD dataset object. |
continent |
Boolean noting whether a column should be added for extracted continent (8 continent model, including Oceania) |
region |
Boolean noting whether a column should be added for extracted subregion |
ISRaD_data object with extracted country names.
Shane Stoner & J. Beem-Miller
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database) # Fill country database.x <- ISRaD.extra.fill_country(database.x)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database) # Fill country database.x <- ISRaD.extra.fill_country(database.x)
Fills frc_obs_date_y and inc_obs_date_y columns from lyr_obs_date_y if not reported.
ISRaD.extra.fill_dates(database)
ISRaD.extra.fill_dates(database)
database |
ISRaD dataset object. |
QAQC does not require frc_obs_date_y or inc_obs_date_y fields to be filled in. Therefore it is recommended to run this function prior to running the functions "ISRaD.extra.fill_rc" and "ISRaD.extra.calc_atm14c", which require xxx_obs_date_y data.
ISRaD_data object with filled frc_obs_date_y and inc_obs_date_y fields.
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill dates database.x <- ISRaD.extra.fill_dates(database) # Fraction table now has lyr_obs_date_y values in frc_obs_date_y field
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill dates database.x <- ISRaD.extra.fill_dates(database) # Fraction table now has lyr_obs_date_y values in frc_obs_date_y field
Fills delta 14c or fraction modern data if either are missing
ISRaD.extra.fill_rc(database)
ISRaD.extra.fill_rc(database)
database |
ISRaD dataset object. |
Warning: xxx_obs_date_y columns must be filled for this to work! This function also fills standard deviation and sigma values. Note that this function replaces two older functions ("ISRaD.extra.fill_fm" and "ISRaD.extra.fill_14c") from ISRaD v1.0 that did not work properly.
ISRaD_data object with filled radiocarbon data columns in all tables
J. Beem-Miller & A. Hoyt
Stuiver and Polach, 1977
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Note that some flx_14c values are NA is.na(database$flux$flx_14c) is.na(database$layer$lyr_14c) # Fill dates database.x <- ISRaD.extra.fill_dates(database) # Fill rc values database.x <- ISRaD.extra.fill_rc(database.x) # Missing radiocarbon data has now been filled if possible, e.g. column flx_14c in the "flux" table is.na(database$flux$flx_14c)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Note that some flx_14c values are NA is.na(database$flux$flx_14c) is.na(database$layer$lyr_14c) # Fill dates database.x <- ISRaD.extra.fill_dates(database) # Fill rc values database.x <- ISRaD.extra.fill_rc(database.x) # Missing radiocarbon data has now been filled if possible, e.g. column flx_14c in the "flux" table is.na(database$flux$flx_14c)
Extracts data from a user-supplied raster file and adds data as a new variable at the profile level
ISRaD.extra.geospatial( database, geodata_directory, CRS = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0" )
ISRaD.extra.geospatial( database, geodata_directory, CRS = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0" )
database |
ISRaD dataset object |
geodata_directory |
Directory where geospatial data are found |
CRS |
Coordinate reference system used for geospatial datasets |
Generic function that uses geographic coordinates of profiles to extract data from one or more raster files.
Raster data will be added as new variables at the profile level.
The new variable name will be a concatenation of "pro_", and the file name (excluding the file extension).
The ISRaD file name convention for geospatial files uses a 6 component string, separated by "_". Missing components can be replaced with "x" ("x"s will be dropped before creating variable names). The 6 components are as follows:
1) Short description of the data type, e.g. "bd" for bulk density
2) Top layer depth or exact depth (numeric, cm)
3) Bottom layer depth (numeric, cm)
4) Year of data observation (numeric)
5) Data units (e.g. mmyr for mean annual precipitation)
6) Any relevant notes
Coordinate reference system can be specified with the "CRS" argument; default is WGS84. Note that all files in geodata_directory must use the same CRS.
Updated ISRaD_extra object with new columns at the profile level
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database <- ISRaD.extra.fill_coords(database) # Run function # Note that geospatial data in pkg is only for the Gaudinski_2001 dataset # Users may supply their own geospatial data as long as it can be read by the raster package database.x <- ISRaD.extra.geospatial(database, geodata_directory = system.file("extdata", "geodata_directory", package = "ISRaD") )
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database <- ISRaD.extra.fill_coords(database) # Run function # Note that geospatial data in pkg is only for the Gaudinski_2001 dataset # Users may supply their own geospatial data as long as it can be read by the raster package database.x <- ISRaD.extra.geospatial(database, geodata_directory = system.file("extdata", "geodata_directory", package = "ISRaD") )
Recode numeric values from categorical geospatial data products
ISRaD.extra.geospatial.keys(database, geodata_keys)
ISRaD.extra.geospatial.keys(database, geodata_keys)
database |
ISRaD dataset object |
geodata_keys |
directory where geospatial data are found |
Generic function that reads .csv files paired with categorical raster data and recodes extracted data in the ISRaD_extra object. For the function to work, the .csv filenames must be identical to the corresponding raster filenames (except for the file extension). Additionally, the first column of the .csv file must contain the numeric identifier and the remaining column/s the corresponding character value/s.
Updated ISRaD_extra object with recoded columns.
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database <- ISRaD.extra.fill_coords(database) # Fill geospatial data database.x <- ISRaD.extra.geospatial(database, geodata_directory = system.file("extdata", "geodata_directory", package = "ISRaD") ) # Recode numeric data to categorical database.x <- ISRaD.extra.geospatial.keys(database.x, geodata_keys = system.file("extdata", "geodata_keys", package = "ISRaD") )
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database <- ISRaD.extra.fill_coords(database) # Fill geospatial data database.x <- ISRaD.extra.geospatial(database, geodata_directory = system.file("extdata", "geodata_directory", package = "ISRaD") ) # Recode numeric data to categorical database.x <- ISRaD.extra.geospatial.keys(database.x, geodata_keys = system.file("extdata", "geodata_keys", package = "ISRaD") )
Normalizes delta 14c values to a given year (norm_year)
ISRaD.extra.norm14c_year( obs_d14c, obs_year, atm_zone, norm_year, df, slow = TRUE, tau = TRUE, verbose = TRUE )
ISRaD.extra.norm14c_year( obs_d14c, obs_year, atm_zone, norm_year, df, slow = TRUE, tau = TRUE, verbose = TRUE )
obs_d14c |
column name in df with observed delta 14c values to be normalized OR numeric value |
obs_year |
column name in df with year in which obs_d14c was observed (sample collection year) OR numeric value |
atm_zone |
column name in df with atmospheric zone for obs_d14c OR character string. Notes: column values/character string must be one of c("NH14C", "SH14C"). "NH14C" > 0 degrees latitude N; "SHC14" > 0 latitude S. |
norm_year |
desired normalization year (numeric) |
df |
data frame with columns for observed d14c (obs_d14c), observation year (obs_year), and atmospheric zone (atm_zone) |
slow |
if TRUE (default) normalized 14c value will be fit using the slower solution for tau |
tau |
if TRUE (default) the solution for tau will be returned along with the normalized 14c value |
verbose |
Show progress bar? TRUE/FALSE (default = TRUE) |
This function can be run on a data frame or with single value input. For the data frame method, the inputs 'obs_d14c', 'obs_year', and 'atm_zone' correspond to column names in the supplied data frame (see Example 1). For the single value method, the inputs for 'obs_d14c', 'obs_year', and 'atm_zone' are single values (Example 2).
The function works by creating a one pool steady-state model using atmospheric 14c over the period 1850 to 2021. Turnover time (tau^-1) is determined by fitting the model to the observed delta 14c (obs_d14c) in the given observation year (obs_year), and the normalized 14c value is calculated by running the model forwards or backwards to the desired normalization year (norm_year). Note that highly negative values of delta 14c (e.g. < -100) are unaffected by normalization and are thus returned unchanged by the function.
The curvature of the bomb peak can lead to two viable solutions for tau in a one pool model. Determining which value is more appropriate depends on the carbon dynamics of the system and thus cannot be determined a priori (Trumbore 2000). The 'slow' parameter can be used to select which tau is used for calculating the normalized 14c value. If 'slow' = TRUE, and the algorithm is able to find two solutions for tau, the function will return normalized 14c values calculated with the slower of the two turnover time solutions. If "slow" = FALSE, the faster turnover time is used.
In certain cases the algorithm used to determine tau fails to converge. This situation arises when observed radiocarbon values are too high relative to the year of observation. This problem is well documented (Gaudinski et al. 2000), and can be solved by introducing a time-lag for the carbon inputs to the system. However, this functionality is beyond the scope of this function. If the algorithm fails to converge, the function will select the tau value giving the closest match for observed 14c in the given observation year and return norm_error = "TRUE".
Example 1 shows how to run the function when the 'df' argument corresponds to a table from an ISRaD object, e.g. "flux", "layer", etc.
Example 2 shows how to run the function when single values are supplied and 'df' is absent.
Note: There is no guarantee that normalized 14c values will be meaningful as the model assumes a well-mixed homogenous system, and this is rarely the case in soils.
data frame with new columns: "norm_14c", "norm_error", and optionally "norm_tau"; OR list with length = 3: "norm_14c", "norm_tau", "norm_error". Note that if is parameter df is not NULL and obs_d14c contains an underscore, e.g. "lyr_14c", supplied names will take the form "lyr_norm_14c", "lyr_norm_error", etc.
J. Beem-Miller and J. Randerson
Gaudinski et al. 2000. Soil carbon cycling in a temperate forest: radiocarbon-based estimates of residence times, sequestration rates and partitioning of fluxes. Biogeochemistry 51: 33-69 doi:10.1023/A:1006301010014
Trumbore, S. 2000. Age of Soil Organic Matter and Soil Respiration: Radiocarbon Constraints on Belowground C Dynamics. Ecological Applications, 10(2): 399–411 doi:10.2307/2641102
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database) # Fill dates database.x <- ISRaD.extra.fill_dates(database.x) # Fill delta 14C from fraction modern database.x <- ISRaD.extra.fill_rc(database.x) # Fill atmospheric 14c database.x <- ISRaD.extra.calc_atm14c(database.x) # Run normalization function for the year 2010 with layer data # Example 1 database.x$layer <- ISRaD.extra.norm14c_year( obs_d14c = "lyr_14c", obs_year = "lyr_obs_date_y", atm_zone = "pro_atm_zone", norm_year = 2010, tau = TRUE, df = database.x$layer, verbose = TRUE ) # Example 2 ISRaD.extra.norm14c_year( obs_d14c = 182.8958, obs_year = 1996, atm_zone = "NH14C", norm_year = 2010 )
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Fill profile coordinates database.x <- ISRaD.extra.fill_coords(database) # Fill dates database.x <- ISRaD.extra.fill_dates(database.x) # Fill delta 14C from fraction modern database.x <- ISRaD.extra.fill_rc(database.x) # Fill atmospheric 14c database.x <- ISRaD.extra.calc_atm14c(database.x) # Run normalization function for the year 2010 with layer data # Example 1 database.x$layer <- ISRaD.extra.norm14c_year( obs_d14c = "lyr_14c", obs_year = "lyr_obs_date_y", atm_zone = "pro_atm_zone", norm_year = 2010, tau = TRUE, df = database.x$layer, verbose = TRUE ) # Example 2 ISRaD.extra.norm14c_year( obs_d14c = 182.8958, obs_year = 1996, atm_zone = "NH14C", norm_year = 2010 )
Joins tables in ISRaD based on linking variables and returns flat data frame/s
ISRaD.flatten(database, table)
ISRaD.flatten(database, table)
database |
ISRaD dataset object: e.g. ISRaD_data, or ISRaD_extra |
table |
ISRaD table of interest ("flux", "layer", "interstitial", "fraction", "incubation"). Must be entered with "". |
ISRaD.extra.flatten generates 2-dimensional matrices for user-specified ISRaD tables by joining higher level tables (metadata, site, profile, layer) to lower level tables (layer, fraction, incubation, flux, interstitial).
A dataframe with nrow = nrow(table) and ncol = sum(ncol(meta), ncol(site), ncol(profile), ..., ncol(table))
J. Beem-Miller
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 fractions <- ISRaD.flatten(database, "fraction") layers <- ISRaD.flatten(database, "layer")
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 fractions <- ISRaD.flatten(database, "fraction") layers <- ISRaD.flatten(database, "layer")
Retrieves most recent version of ISRaD data from github
ISRaD.getdata( directory, dataset = "full", extra = FALSE, force_download = FALSE )
ISRaD.getdata( directory, dataset = "full", extra = FALSE, force_download = FALSE )
directory |
Location of ISRaD_database_files folder. If not found, it will be created. |
dataset |
Specify which data you want. Options are c("full", flux","interstitial","incubation","fraction","layer") |
extra |
TRUE/FALSE. If TRUE, the ISRaD_extra object will be returned. If FALSE, ISRaD_data will be returned. Default is FALSE. |
force_download |
TRUE/FALSE. If ISRaD_database files already exist in the specified directory, new data will not be downloaded by default. If force_download is set to TRUE, the newest data from github will be downloaded and overwrite any existing files. |
ISRaD data object
# Return full dataset ("full") ISRaD_full <- ISRaD.getdata(tempdir(), dataset = "full", extra = FALSE) # Return full dataset plus "extra" filled data ISRaD_extra <- ISRaD.getdata(tempdir(), dataset = "full", extra = TRUE) # Return only fraction data, including filled fraction data ISRaD_fractions <- ISRaD.getdata(tempdir(), dataset = "fraction", extra = TRUE)
# Return full dataset ("full") ISRaD_full <- ISRaD.getdata(tempdir(), dataset = "full", extra = FALSE) # Return full dataset plus "extra" filled data ISRaD_extra <- ISRaD.getdata(tempdir(), dataset = "full", extra = TRUE) # Return only fraction data, including filled fraction data ISRaD_fractions <- ISRaD.getdata(tempdir(), dataset = "fraction", extra = TRUE)
Reads ISRaD data object from Excel file in standard template format
ISRaD.read.entry( entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD") )
ISRaD.read.entry( entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD") )
entry |
ISRaD data object. |
template_file |
Directory path and name of template file to use (defaults to the ISRaD_Master_Template file built into the package). |
J. Beem-Miller
# Load example dataset Gaudinski_2001 entry <- ISRaD::Gaudinski_2001 ISRaD.save.entry( entry = entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile = file.path(tempdir(), "Gaudinski_2001.xlsx") ) # Read in .xlsx file ISRaD.read.entry(file.path(tempdir(), "Gaudinski_2001.xlsx"))
# Load example dataset Gaudinski_2001 entry <- ISRaD::Gaudinski_2001 ISRaD.save.entry( entry = entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile = file.path(tempdir(), "Gaudinski_2001.xlsx") ) # Read in .xlsx file ISRaD.read.entry(file.path(tempdir(), "Gaudinski_2001.xlsx"))
Generates a report of counts of observations at each level of the database
ISRaD.rep.count.all(database)
ISRaD.rep.count.all(database)
database |
ISRaD data object |
A tibble of observation counts, one column for each database table.
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 ISRaD.rep.count.all(database)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 ISRaD.rep.count.all(database)
Generates a report of fraction level observations, including fraction scheme and properties. Note that this function only counts rows, not 14C observations.
ISRaD.rep.count.frc(database)
ISRaD.rep.count.frc(database)
database |
ISRaD data object |
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 ISRaD.rep.count.frc(database)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 ISRaD.rep.count.frc(database)
Generates a report of metadata statistics for all entries
ISRaD.rep.entry.stats(database)
ISRaD.rep.entry.stats(database)
database |
ISRaD data object |
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 ISRaD.rep.entry.stats(database)
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 ISRaD.rep.entry.stats(database)
Generates a world map showing locations of all ISRaD sites
ISRaD.rep.site.map(database)
ISRaD.rep.site.map(database)
database |
ISRaD data object |
# Obtain current ISRaD data database <- ISRaD.getdata(tempdir(), dataset = "full", extra = FALSE) # Generate a map of all ISRaD sites ISRaD.rep.site.map(database)
# Obtain current ISRaD data database <- ISRaD.getdata(tempdir(), dataset = "full", extra = FALSE) # Generate a map of all ISRaD sites ISRaD.rep.site.map(database)
Generate basic summary reports of ISRaD data
ISRaD.report(database, report)
ISRaD.report(database, report)
database |
ISRaD data object |
report |
Parameter to define which type of report is desired. The default is "count.all" other options include "entry.stats", "count.frc", or "site.map". |
Wrapper for the simple reporting functions ISRaD.rep.count.all, ISRaD.rep.count.frc, ISRaD.rep.entry.stats, ISRaD.rep.site.map
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Report metadata statistics ISRaD.report(database, report = "entry.stats") # Report summary statistics for all levels of the database ISRaD.report(database, report = "count.all") # Generate a map of all ISRaD sites ISRaD.report(database, report = "site.map")
# Load example dataset Gaudinski_2001 database <- ISRaD::Gaudinski_2001 # Report metadata statistics ISRaD.report(database, report = "entry.stats") # Report summary statistics for all levels of the database ISRaD.report(database, report = "count.all") # Generate a map of all ISRaD sites ISRaD.report(database, report = "site.map")
Saves ISRaD data object to .xlsx file
ISRaD.save.entry( entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile )
ISRaD.save.entry( entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile )
entry |
ISRaD data object |
template_file |
Directory path and name of template file to use (defaults to the ISRaD_Master_Template file built into the package). Not recommended to change this. |
outfile |
File name and path for .xlsx output |
This function can be used to save a single entry (or a compiled database in the standard template format) to an .xlsx file.
Note: Replaces the function "ISRaD.save.xlsx" as that function depended on the package openxlsx, which was unstable at the time. This a simpler function and does not maintain the formatting of the template file. The code for the original function is available in the ISRaD github repository in the devScripts directory.
J. Beem-Miller
# Load example dataset Gaudinski_2001 entry <- ISRaD::Gaudinski_2001 ISRaD.save.entry( entry = entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile = file.path(tempdir(), "Gaudinski_2001.xlsx") )
# Load example dataset Gaudinski_2001 entry <- ISRaD::Gaudinski_2001 ISRaD.save.entry( entry = entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile = file.path(tempdir(), "Gaudinski_2001.xlsx") )
Checks template files for data coherence, formatting, and data entry errors
QAQC( file, writeQCreport = FALSE, outfile_QAQC = "", summaryStats = TRUE, dataReport = FALSE, checkdoi = TRUE, verbose = TRUE, local = TRUE )
QAQC( file, writeQCreport = FALSE, outfile_QAQC = "", summaryStats = TRUE, dataReport = FALSE, checkdoi = TRUE, verbose = TRUE, local = TRUE )
file |
File path for template file to be checked |
writeQCreport |
If TRUE, a text report of the QC output will be written to the outfile. Default is FALSE |
outfile_QAQC |
Filename of the output file (if writeQCreport is TRUE). Default is NULL, with the outfile being written to the directory where the template file is stored and named according to the file being checked. |
summaryStats |
Prints summary statistics. Default is TRUE. |
dataReport |
Prints list structure of database. Default is FALSE. |
checkdoi |
Set to FALSE if you do not want the QAQC check to validate DOIs (if TRUE this will be time consuming). Default is TRUE. |
verbose |
Set to TRUE to print results of function to console. Default is TRUE. |
local |
Set to FALSE to fetch most up-to-date template and template info files. If TRUE, the local files or files from CRAN package will be used. Default is TRUE. |
This function can also be called from the ISRaD website.
# Load example dataset Gaudinski_2001 entry <- ISRaD::Gaudinski_2001 # Save as .xlsx file ISRaD.save.entry( entry = entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile = file.path(tempdir(), "Gaudinski_2001.xlsx") ) # Run QAQC QAQC(file.path(tempdir(), "Gaudinski_2001.xlsx"))
# Load example dataset Gaudinski_2001 entry <- ISRaD::Gaudinski_2001 # Save as .xlsx file ISRaD.save.entry( entry = entry, template_file = system.file("extdata", "ISRaD_Master_Template.xlsx", package = "ISRaD"), outfile = file.path(tempdir(), "Gaudinski_2001.xlsx") ) # Run QAQC QAQC(file.path(tempdir(), "Gaudinski_2001.xlsx"))