arrange_data: Arrange Data for Free Recall Scoring

Description Usage Arguments Value Examples

View source: R/arrange_data.R

Description

This function takes wide format free recall data where all responses are stored in the same cell and converts it to long format.

Usage

1
arrange_data(data, responses, sep, id, repeated = NULL)

Arguments

data

a dataframe of the variables you would like to return. Other variables will be included in the returned output in long format if they represent a one to one match with the participant ID. If you have repeated data, please use the repeated argument or run this function several times for each trial.

responses

a column name in the dataframe that contains the participant answers for each item in quotes (i.e., "column")

sep

a character separating each response in quotes - example: ",".

id

a column name containing participant ID numbers from the original dataframe

repeated

(optional) a single column name or set of columns that indicate repeated measures columns you would like to keep with the data. You should include all columns that are not a one to one match with the subject ID (i.e., participants saw multiple trials). Please see our vignette for an example.

Value

A dataframe of the participant answers including:

Sub.ID

The participant id number

response

The participant response

position

The position number of the response listed

other

Any additional columns included

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#This dataset includes a subject number, set of answers, and
#experiment condition.

data(wide_data)

DF_long <- arrange_data(
 data = wide_data,
 responses = "Response",
 sep = ",",
 id = "Sub.ID")

head(DF_long)

lrd documentation built on Dec. 9, 2021, 5:06 p.m.