ImportCSV {ArchaeoPhases} | R Documentation |
Import a CSV file containing the output of the MCMC algorithm
ImportCSV(
file,
dec = ".",
sep = ",",
comment.char = "#",
header = TRUE,
iterationColumn = NULL,
referenceYear = NULL,
rowToWithdraw = NULL,
bin.width = NULL
)
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 |
sep |
Field separator character for the use of |
comment.char |
Character vector of length one containing a single
character or an empty string for the use of |
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 = |
referenceYear |
Year of reference for MCMC in date format other than
BC/AD, default = |
rowToWithdraw |
Number of the row to be withdrawn or "last" for the
last row of the data frame, default = |
bin.width |
Bin width specified in a BCal project (note that |
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.
A data frame containing a representation of the data in the file.
Anne Philippe, Anne.Philippe@univ-nantes.fr,
Thomas S. Dye, tsd@tsdye.online, and
Marie-Anne Vibet, Marie-Anne.Vibet@univ-nantes.fr
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)