Description Usage Arguments Value Author(s) See Also Examples
Use the readSC
function to import single-case data from structured
.csv or the readSC.excel
function for importing excel files.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
filename |
A character string defining the file to be imported (e.g.
|
data |
A data frame. As an alternative to |
sep |
The field separator string. Values within rows have to be
separated by this string. Default is |
dec |
The string used for decimal points in the file. Must be a single
character. Default is |
sort.labels |
If set TRUE, the resulting list is sorted by label names (alphabetically increasing). |
cvar |
Sets the variable name of the "case" variable. Deafults to |
pvar |
Sets the variable name of the "phase" variable. Deafults to |
dvar |
Sets the variable name of the "values" variable. Deafults to |
mvar |
Sets the variable name of the "mt" variable. Deafults to |
phase.names |
A character vector with phase names. Deafults to the phase names provided in the phase variable. |
type |
Format of the file to be imported. Either "csv" or "excel" is possible. |
... |
Further arguments passed to the |
Returns a single-case data frame. See scdf
to learn
about the format of these data frames.
Juergen Wilbert
read.table
, writeSC
, scdf
, readRDS
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Read SC-data from a file named "study1.csv" in your working directory
# study1 <- readSC("study1.csv")
## Read SC-data from a .csv-file with semicolon as field and comma as decimal separator
# study2 <- readSC("study2.csv", sep = ";", dec = ",")
## writeSc and readSC
filename <- file.path(tempdir(),"test.csv")
writeSC(exampleA1B1A2B2_zvt, filename)
dat <- readSC(filename, cvar = "case", pvar = "part", dvar = "zvt", mvar = "day")
res1 <- describeSC(exampleA1B1A2B2_zvt)$descriptives
res2 <- describeSC(dat)$descriptives
identical(res1,res2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.