survey: Create a survey object

Description Usage Arguments Structure/naming convention for list Note Author(s) Examples

Description

First step in creating a survey that can be used with generate_report. The function accepts either a list or a data.frame as input, and will only retain information following the structure and naming convention.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
survey(x)

get_data(srv)

lowercase_names(srv)

is.survey(x)

as.survey(x)

## Default S3 method:
as.survey(x)

## S3 method for class 'survey'
as.survey(x)

## S3 method for class 'survey'
print(x, width = getOption("width"))

Arguments

x

A list or a data.frame

Structure/naming convention for list

df

The dataset from the current study, either in it's processed or raw format. (Alias: data).

cd

Optional: A dataset to compare or contrast the current study to. Typically used when comparing a smaller (web) study to the national study. (Alias: contrast data).

hd

Optional: Historical data used to compare the present study against. (Alias: historical data).

ents

Data regarding the entities (typically Q1), and their respecitve marketshares etc. (Alias: entities).

mm

The measurement model (questionnaire) and additional information describing the variables in the data. (Alias: measurement model).

cfg

Config for the study and generate_report, including translations/printed names for latent variables. (Alias: config).

A structure and naming convention is also required for the measurement model, entities and config. See add_model, add_entities and add_config for information.

Note

When using write_data with a survey object, all names will be converted to their longer versions (alias). E.g. "df" becomes "data" and so forth. Conversely, when converting a list to survey with survey or as.survey, long names are converted to their short version. This is done for brevity when coding.

Author(s)

Kristian D. Olsen

Examples

1
x <- survey(data.frame("test" = 1, stringsAsFactors = FALSE))

itsdalmo/reporttool documentation built on May 18, 2019, 7:11 a.m.