Learn R Programming

scan (version 0.20)

readSC: Read single-case data from files

Description

Use the readSC function to import single-case data from structured .csv-files.

Usage

readSC(filename, sep = ",", dec = ".", sort.labels = FALSE,
       phase.names = c("A", "B"), ...)

Arguments

filename

A character string defining the file to be imported (e.g. "SC_Anita.csv".

sep

The field separator string. Values within rows have to be separated by this string. Default is sep = ",".

dec

The string used for decimal points in the file. Must be a single character. Default is dec = "."

sort.labels

If set TRUE, the resulting list is sorted by label names (alphabetically increasing).

phase.names

Name of the phases. Usually they should be "A" and "B". I the file contains different names, these are converted to "A" and "B".

Further arguments passed to the read.table command.

Value

Returns a single-case data frame. See makeSCDF to learn about the format of these data frames.

See Also

read.table, writeSC, makeSCDF

Examples

Run this code
# NOT RUN {
## 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 = ",")
# }

Run the code above in your browser using DataLab