ImportCSV {ArchaeoPhases}R Documentation

Importing a CSV file

Description

Import a CSV file containing the output of the MCMC algorithm

Usage

ImportCSV(
  file,
  dec = ".",
  sep = ",",
  comment.char = "#",
  header = TRUE,
  iterationColumn = NULL,
  referenceYear = NULL,
  rowToWithdraw = NULL,
  bin.width = NULL
)

Arguments

file

Name of the CSV file containing the output of the MCMC algorithm.

dec

Character used in the file for decimal points for the use of read.csv().

sep

Field separator character for the use of read.csv().

comment.char

Character vector of length one containing a single character or an empty string for the use of read.csv().

header

Logical value indicating whether the file contains the names of the variables as its first line.

iterationColumn

Column number corresponding to the iteration values, default = NULL.

referenceYear

Year of reference for MCMC in date format other than BC/AD, default = NULL.

rowToWithdraw

Number of the row to be withdrawn or "last" for the last row of the data frame, default = NULL.

bin.width

Bin width specified in a BCal project (note that bin.width does not have to be set if the BCal default bin width of 1 is used).

Details

Use of the read.csv() function with default values for CSV files produced by ChronoModel software. For MCMC in a date format different from BC/AD, use the parameter referenceYear to convert the MCMC to BC/AD, otherwise the remaining functions of ArchaeoPhases will not work. MCMC files generated by BCal may contain an empty last row. This row should be withdrawn using the rowToWithdraw parameter. Otherwise, the functions of ArchaeoPhases will not work properly.

Value

A data frame containing a representation of the data in the file.

Author(s)

Anne Philippe, Anne.Philippe@univ-nantes.fr,

Thomas S. Dye, tsd@tsdye.online, and

Marie-Anne Vibet, Marie-Anne.Vibet@univ-nantes.fr

See Also

ImportCSV.BCal

read_chronomodel

read_oxcal

Examples


  data(Events)
## Not run: 
  write.csv(Events, "data.csv", row.names=FALSE)
  data = ImportCSV("data.csv", dec = '.', sep=',', comment.char='#',
                   header = TRUE, iterationColumn = 1)

  # Import of MCMC generated by BCal and extracted in cal BP
  # (the year of reference is 1950)
  if (requireNamespace("ArchaeoPhases.dataset", quietly = TRUE)) {
  data(Fishpond)
  write.csv(Fishpond, "fishpond_MCMC.csv", row.names=FALSE)
  Fishpond = ImportCSV("fishpond_MCMC.csv", dec = '.', sep=',',
                       header = TRUE, iterationColumn = 1,
                       referenceYear = 1950, rowToWithdraw = "last")}

## End(Not run)



[Package ArchaeoPhases version 1.5 Index]