Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

longSCDF

Creating a long format data frame from several single-case data frames (scdf).


Description

The longSCDF function transposes a scdf into one long data frame. Additionally, a data frame can be merged that includes data of the subjects. This might be helpful to prepare data to be used with other packages than scan.

Usage

longSCDF(data, l2 = NULL, id = "case")

Arguments

data

A single-case data frame. See scdf to learn about this format.

l2

A data frame providing additional variables at Level 2. The scdf has to have names for all cases and the Level 2 data frame has to have a column with corresponding case names.

id

Variable name of the Level 2 data frame that contains the case names.

Value

Returns one data frame with data of all single-cases structured by the case variable.

Author(s)

Juergen Wilbert

See Also

Other data manipulation functions: fill_missing(), outlier(), ranks(), shift(), smooth_cases(), standardize(), truncate_phase()

Examples

## Convert the list of three single-case data frames from Grosche (2011) into one long data frame
Grosche2011
Grosche2011_long <- longSCDF(Grosche2011)
Grosche2011_long

## Combine an scdf with data for l2
Leidig2018_long <- longSCDF(Leidig2018, l2 = Leidig2018_l2)
names(Leidig2018_long)
summary(Leidig2018_long)

scan

Single-Case Data Analyses for Single and Multiple Baseline Designs

v0.51
GPL
Authors
Juergen Wilbert [aut, cre], Timo Lueke [aut]
Initial release
2021-2-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.