Learn R Programming

sitepickR (version 0.0.1)

prepDF: Prepare nested dataset

Description

Prepare nested dataset

Usage

prepDF(df, unitID, subunitID)

Value

processed dataframe

Arguments

df

dataframe

unitID

character; unit column name in original dataset

subunitID

character; sub-unit column name in original dataset

Examples

Run this code
################################################################################
############## Prepare dataframe [sitepickR Package] ###########################
######### Robert Olsen, Elizabeth A. Stuart & Elena Badillo-Goicoechea (2022) ##

# Basic usage of prepDF()

rawCCD <- sitepickR::rawCCD

uSampVarsCCD <- c("w.pct.frlunch", "w.pct.black", "w.pct.hisp", "w.pct.female") 
suSampVarsCCD <- c("sch.pct.frlunch", "sch.pct.black", "sch.pct.hisp", "sch.pct.female")

dfCCD <- prepDF(rawCCD,
                unitID="LEAID", subunitID="NCESSCH")

Run the code above in your browser using DataLab