Learn R Programming

translateSPSS2R (version 1.0.0)

as.xpssFrame: Coerces data.frames to xpssFrame objects

Description

Function to check if an object is an xpssFrame, or coerce it to one if possible.

Usage

as.xpssFrame(x)
is.xpssFrame(x)

is.xpssFrame(x)

Arguments

x
any (non-empty) R object.

Value

  • as.xpssFrame returns an xpssFrame, with the essential attributes DO_IF, FILTER, SPLIT_FILE, TEMPORORY and WEIGHTS for the actual dataset and additional variable.label and varname attributes for every variable in the dataset. is.xpssFrame returns TRUE if its argument is a xpssFrame (that is, has "xpssFrame" amongst its classes) and FALSE otherwise.

Examples

Run this code
data(fromXPSS)
is.xpssFrame(fromXPSS)
temp <- data.frame(x=1:5, y = 2:6, z=c("a","b","c","d","e"))
is.xpssFrame(temp)
temp <- as.xpssFrame(temp)
is.xpssFrame(temp)

Run the code above in your browser using DataLab