as.surveyor: Creates object of class surveyor.

Description Usage Arguments Value Examples

Description

A surveyor object describes the data and meta-data in the survey that will be analysed by the analysis and reporting functions in the surveyor package.

Usage

1
2
  as.surveyor(sdata, crossbreak = sdata$crossbreak,
    weight = sdata$weight, defaults = surveyorDefaults())

Arguments

sdata

surveydata object. See also as.surveydata

crossbreak

List of named factors that contain crossbreak data. Each factor must have the same length as the columns in the surveydata object

weight

Numeric vector with weighting data. Must have the same length as the columns in the surveydata object

defaults

Surveyor defaults. See also surveyorDefaults

Value

A list object of class surveyor:

sdata

surveydata object. See also as.surveydata

cbreak
plot_title
weight
defaults

Examples

1
2
3
4
5
6
library(surveydata)
sdata <- data.frame(Q1=c(11, 12), Q4_1 = c(1,2), Q4_2=c(3,4), Q4_3=c(5,6))
qtext <- c("Question 1", "Question 4: red", "Question 4: yellow", "Question 4: blue")
varlabels(sdata) <- qtext
sdata <- as.surveydata(sdata, renameVarlabels=TRUE)
s <- as.surveyor(sdata, crossbreak=list(breaks=factor(c("aa", "bb"))), weight=c(1,1))

andrie/surveyor documentation built on May 10, 2019, 11:21 a.m.