write.star.csv: Write STAR CSV

Description Usage Arguments Details Value See Also Examples

View source: R/write.star.csv.R

Description

Write a STAR object to CSV files ‘metadata.csv’ and ‘timeseries.csv’.

Usage

1
2
3
4
write.star.csv(star, dir = TRUE, topdir = NULL, mfile = "metadata.csv",
  tfile = "timeseries.csv", quote = TRUE, row.names = FALSE,
  fileEncoding = "UTF-8", dos = TRUE, force = FALSE, quiet = FALSE,
  ...)

Arguments

star

STAR object, a list containing Metadata and TimeSeries.

dir

an optional directory to write the CSV files into, or a logical value. See details below.

topdir

an optional directory containing dir. See details below.

mfile

a filename for the metadata.

tfile

a filename for the time series.

quote

whether to quote strings.

row.names

whether to include row names.

fileEncoding

character encoding for output file.

dos

whether to ensure the resulting CSV files have Dos line endings (CRLF).

force

whether to overwrite existing files.

quiet

whether to suppress messages.

...

passed to write.csv.

Details

The special value dir = TRUE can be used as shorthand for dir = star$Metadata$Assessment_ID, which may be a suitable directory name.

The special value dir = FALSE is equivalent to dir = "." which will write the CSV files into the current directory.

The topdir argument can be used to organize the output from multiple STAR objects in one top directory. For example,

1
2
3
4
hake_4 <- read.template("STAR_2019_HKE_4.xlsx")
hake_5 <- read.template("STAR_2019_HKE_5.xlsx")
write.star.csv(hake_4, topdir="csv")
write.star.csv(hake_5, topdir="csv")

will produce four files in the following directory structure:

1
2
3
4
5
6
7
csv/
    STAR_2019_HKE_4/
        metadata.csv
        timeseries.csv
    STAR_2019_HKE_5/
        metadata.csv
        timeseries.csv

Value

TRUE if CSV files were created, otherwise FALSE.

See Also

write.csv is the underlying function used to write a table to a CSV file.

export.many.csv exports a cluster (list) of STAR objects to CSV files.

read.template reads an Excel STAR template into a STAR object.

read.star.csv reads a pair of STAR CSV files into a STAR object.

gfcmSTAR-package gives an overview of the package.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

write.star.csv(star)

write.star.csv(star, dir="hake_5")

write.star.csv(star, topdir="csv")

## End(Not run)

gfcm/gfcmSTAR documentation built on Feb. 5, 2022, 2:14 p.m.