Learn R Programming

EdSurvey (version 1.0.6)

readNAEP: Creates an edsurvey.data.frame.

Description

Opens a connection to the data file residing on the disk and returns information about the file and data.

Usage

readNAEP(filepath, defaultWeight = "origwt", defaultPvs = "composite",
  omittedLevels = c("Multiple", NA, "Omitted"), frPath = NULL)

Arguments

filepath

character indicating the location and name of the file.

defaultWeight

character that indicates the default weight.

defaultPvs

character that indicates the default plausible value.

omittedLevels

character vector indicating which factor levels (really, labels) should be excluded. When set to the default value of c('Multiple',NA,'Omitted'), adds the vector to the edsurvey.data.frame.

frPath

character indicating the location of the fr2 parameter file included with the data companion.

Value

An edsurvey.data.frame containing the following elements:

userConditions

A list containing all user conditions set using the subset.edsurvey.data.frame method.

defaultConditions

The default conditions to be applied to the edsurvey.data.frame.

data

An LaF object containing a connection the student data set on disk.

dataSch

An LaF object containing a connection the school data set on disk.

weights

A list containing the weights found on the edsurvey.data.frame.

pvvar

A list containing the plausible values found on the edsurvey.data.frame.

subject

The subject of the data set contained in the edsurvey.data.frame.

year

The year of assessment of the data set contained in the edsurvey.data.frame.

assessmentCode

The code of the data set contained in the edsurvey.data.frame.

dataType

The type of data (whether student or school) contained in the edsurvey.data.frame.

gradeLevel

The grade of the data set contained in the edsurvey.data.frame.

achievementLevels

Default NAEP achievement cutoff scores.

omittedLevels

The levels of the factor variables that will be omitted from the edsurvey.data.frame.

fileFormat

A data.frame containing the parsed information from the student .fr2 file associated with the data.

fileFormatSchool

A data.frame containing the parsed information from the school .fr2 file associated with the data.

survey

The type of survey data contained in the edsurvey.data.frame.

Details

The function uses precompiled label information for data to read in a fixed-width format file, and uses prestored data to get information about the file.

Examples

Run this code
# NOT RUN {
# read in the example data (generated, not real student data)
sdf <- readNAEP(system.file("extdata/data", "M36NT2PM.dat", package = "NAEPprimer"))
sdf

# }
# NOT RUN {
# To read in an NCES file first set the directory to the ~/Data subfolder,
# then read in the appropriate .dat file:
setwd("location/of/Data")
sdf <- readNAEP(filepath="M36NT2PM.dat")

# Or read in the .dat file directly through the folder pathway:
sdf <- readNAEP(filepath="location/of/Data/M36NT2PM.dat")
# }

Run the code above in your browser using DataLab