export_entity: Reshape epd.entity objects to CLAM or BACON format

Description Usage Arguments Details Value References Examples

Description

This function takes epd.entity-class or epd.entity.df-class objects, as those returned by get_entity or entity_to_matrices, extracts datation information and reshapes it to complies with CLAM or BACON format.

Usage

1
2
3
4
5
6
7
8
9
export_entity(format, x, chronology = NULL, incl_chron_not_in_c14 = NULL,
  incl_c14_not_in_chron = NULL, use_c14_conf_age = NULL,
  use_c14_conf_depth = NULL, include_depths = TRUE, incl_events = NULL)

## S4 method for signature 'character,epd.entity'
export_entity(format, x, chronology = NULL,
  incl_chron_not_in_c14 = NULL, incl_c14_not_in_chron = NULL,
  use_c14_conf_age = NULL, use_c14_conf_depth = NULL,
  include_depths = TRUE, incl_events = NULL)

Arguments

format

character Character string indicating whether to export to "clam" or to "bacon" format.

x

epd.entity epd.entity-class or epd.entity.df-class objects from which all information will be extracted to compose the clam or bacon table and file.

chronology

numeric Number indicating the chronology from which to extract the agebasis for the "clam" or "bacon" file. If unspecified, the function use the default chronology according to the EPD for that particular entity.

incl_chron_not_in_c14

logical Logical value indicating whether the function should include in the result agebasis present in the specified (or the default) chronology (TRUE) but not in the C14 table, or should not include them (FALSE).

incl_c14_not_in_chron

logical Logical value indicating whether the function should include in the result agebasis present in the C14 data but not present in the specified (or default) chronology (TRUE), or should not include them (FALSE).

use_c14_conf_age

logical Logical value indicating whether the function should use data from C14 table when there are conflicting ages between the C14 table or the chronology (TRUE), or it should take data from the chronology instead (FALSE).

use_c14_conf_depth

logical Logical value indicating whether the function should use data from C14 table when there are conflicting depths between the C14 table or the chronology (TRUE), or it should take data from the chronology instead (FALSE).

include_depths

logical Logical value indicating whether depths of pollen samples should be exported too. The default value is TRUE. This is helpful because running CLAM or BACON with depths calculate the calibrated ages for those samples in the same step.

incl_events

logical Logical value indicating whether events information should be included (TRUE), or not (FALSE).

Details

The function has an interactive implementation. If some of the parameters incl_chron_not_in_c14, incl_c14_not_in_chron, use_c14_conf_age, and/or use_c14_conf_depth are not specified, the function will check the data and ask the user how it should proceed regarding some conflicts in the data between C14 data and agebasis tables.

Value

Data frame with specific format for "CLAM" or "BACON" age-depth modelling softwares. CLAM format has 7 columns: $ID, $C14_age, $cal_age, $error, $reservoir, $depth, and $thickness. $ID is the code of the radiocarbon (C14) samples. $C14_age is the radiocarbon (C14) dates. $error is the error estimated in the radiocarbon (C14) datation of the samples. $reservoir is to specify if the samples have marine reservoir effects. $depth is the depth in cm of the radiocarbon samples. $thickness is the tickness of the radiocarbon samples. BACON format has 4 columns: $labID, $age, $error, and $depth. $labID is the code of the radiocarbon (C14) samples. $age is the radiocarbon (C14) date. $error is the error estimated in the radiocarbon (C14) datation for the samples. $depth is the depth in cm of the radiocarbon samples. The function also produce the files required by CLAM or BACON in the working directory according to this folder structure: ~/{format}/Cores/{entity_number}/ The function creates a file .csv ({entity_number}.csv) with the radiocarbon data and two .txt ({entity_number}_depths.txt and {entity_number}_depthsID.txt). The last one is not used by CLAM or BACON but it might be useful to follow track of samples depths.

References

http://www.chrono.qub.ac.uk/blaauw/clam.html

http://chrono.qub.ac.uk/blaauw/bacon.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
epd.connection <- connect_to_epd(host = "localhost", database = "epd",
                              user = "epdr", password = "epdrpw")
epd.400 <- get_entity(400, epd.connection)
export_entity("clam", epd.400) # Also check new folders in your working directory
export_entity("bacon", epd.400) # Also check new folders in your working directory
epd.1 <- get_entity(1, epd.connection)
export_entity("clam", epd.1)
export_entity("bacon", epd.1)

## End(Not run)

dinilu/EPDr documentation built on Jan. 13, 2018, 9:03 p.m.