add_entities: Add a summary of entities to a survey

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

Description

Third step in creating a survey that can be used with generate_report. The function accepts a data.frame as input, but columns must be correctly named or be dropped (see description below). If no data is provided (entities = NULL), add_entities will generate a suggestion based on the data.

Usage

1
2
3
4
5
6
add_entities(srv, entities = NULL)

get_marketshare(srv, ent = NULL)

## S3 method for class 'survey_ents'
print(ents, width = getOption("width"))

Arguments

srv

A survey object.

entity

Optional: Specify a data.frame which contains the summary and information for entities.

Structure/naming convention for ents

entity

List of names for mainentity found in the data.

n

The number of rows/observations per entity.

marketshare

The marketshare associated with each entity. This is used by add_weigts when calculating weights.

other

Specifies whether the entity should be collected among "other" entities. I.e., when it is too small to publish and should be excluded from reports.

A structure and naming convention is also required for the survey itself, see help(survey) for information.

Note

This function requires that mainentity is specified in the measurement model. See set_association for more information.

Author(s)

Kristian D. Olsen

Examples

1
2
x <- survey(data.frame("test" = 1, stringsAsFactors = FALSE))
x %>% add_mm() %>% add_entities()

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