| write_scdf | R Documentation |
This function restructures and writes single-case data into a .csv-file.
write_scdf(data, filename = NULL, sep = ",", dec = ".", ...)
data |
A single-case data frame. See |
filename |
A character string defining the output file name (e.g.
|
sep |
The field separator string. Values within each row of x are separated by this string. |
dec |
The string to use for decimal points in numeric or complex columns: must be a single character. |
... |
Further arguments passed to write.table. |
This is a wrapper for the write.table function with predefined parameters. It converts the single-case data file into a data frame and writes it to a .csv-file. Each single-case data set is stacked below each other and an additional column "case" is added to identify the different single-cases.
Invisibly returns NULL.
Juergen Wilbert
write.table(), saveRDS()
Other io-functions:
convert(),
read_scdf()
## write single-case data to a .csv-file
filename <- tempfile(fileext = ".csv")
write_scdf(exampleAB, filename)
## write multiple cases to a .csv-file with semicolon as field and comma as
## decimal separator
write_scdf(Grosche2011, filename, sep = ";", dec = ",")
## read_scdf and write_scdf
write_scdf(exampleA1B1A2B2_zvt, filename)
dat <- read_scdf(filename, cvar = "case", pvar = "part",
dvar = "zvt", mvar = "day")
res1 <- describe(exampleA1B1A2B2_zvt)$descriptives
res2 <- describe(dat)$descriptives
all.equal(res1,res2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.