csv.exdf | R Documentation |
Functions for reading and writing CSV files that represent an
exdf
object.
read.csv.exdf(file, ...)
write.csv.exdf(x, file, ...)
file |
The name of the file which the data are to be read from; to be passed to
|
... |
Additional arguments to be passed to |
x |
An |
An exdf
object can be written to a CSV file by directly calling
write.csv
, but this approach causes some column names to
be unintentionally modified. For example, any spaces will be replaced by
periods. This can potentially cause problems when reloading the data from the
CSV file.
Instead, it is preferred to use write.csv.exdf
, which will not modify
any column names. When writing the CSV file, it is saved with the column names
in the first row, the categories in the second row, the units in the third
row, and the data in the remaining rows.
The resulting file can be read using read.csv.exdf
. Here, the names,
categories, and units are read from the first three rows of the specified
file, and the data values from the remaining rows. An exdf
object is then created from this information.
The write.csv.exdf
function does not return anything. The
read.csv.exdf
function returns an exdf
object
representing the contents of file
.
# Read a CSV file included with the PhotoGEA package; this file was created
# using `write.csv.exdf`.
licor_file <- read.csv.exdf(
PhotoGEA_example_file_path('ball_berry_1.csv')
)
# Now rewrite this to a temporary CSV file
tf <- tempfile(fileext = ".csv")
tf
write.csv.exdf(licor_file, tf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.