complete_observations: Remove Incomplete Observations from Data Frame

View source: R/utils.R

complete_observationsR Documentation

Remove Incomplete Observations from Data Frame

Description

This is an internal function that is used to remove incomplete observations from a data.frame. It removes (1) explicit NAs and (2) cases with implicit NAs, i.e. participants who did not provide observations for all combinations of (possibly multiple) within-subjects factors.

Usage

complete_observations(data, id, within, dv)

Arguments

data

The data.frame to be processed.

id

Character. Name of the column containing the subject identifier.

within

Character. Names of the columns containing within-subjects factors.

dv

Character. Name of the column containing the dependent variable.

Value

A data.frame where NAs and incomplete observations are removed. It also has up to two additional attributes removed_cases_explicit_NA and removed_cases_implicit_NA, carrying the subject identifiers of participants whose data has been removed.


papaja documentation built on Oct. 30, 2024, 9:09 a.m.