Learn R Programming

dgo (version 0.2.15)

dgirtin-class: A class for data ready to model

Description

shape() generates objects of class dgirtIn for modeling with dgirt() and dgmrp().

Usage

summary(object, ...)

# S4 method for dgirtIn summary(object, ...)

print(x, ...)

# S4 method for dgirtIn print(x, ...)

get_item_names(x)

# S4 method for dgirtIn get_item_names(x)

get_n(x, by = NULL, aggregate_name = NULL)

# S4 method for dgirtIn get_n(x, by = NULL, aggregate_name = NULL)

get_item_n(x, by = NULL, aggregate_data = FALSE)

# S4 method for dgirtIn get_item_n(x, by = NULL, aggregate_data = FALSE)

# S4 method for dgirtIn show(object)

Arguments

object

An object of class dgirtIn as returned by shape.

...

Unused.

x

An object of class dgirtIn as returned by shape.

by

The name of a grouping variable.

aggregate_name

If specified get_n will operate on the table passed to shape as aggregate_data instead of on the individual data and count nonmissingness in the given variable.

aggregate_data

If specified get_item_n will operate on the table passed to shape as aggregate_data instead of on the individual data.

Value

A list of item names.

Examples

Run this code
# NOT RUN {
data(toy_dgirt_in)
get_item_names(toy_dgirt_in)
get_n(toy_dgirt_in)
get_n(toy_dgirt_in, by = "year")
get_n(toy_dgirt_in, by = "source")
get_item_n(toy_dgirt_in)
get_item_n(toy_dgirt_in, by = "year")
data(toy_dgirt_in)
get_item_names(toy_dgirt_in)
# respondent count
data(toy_dgirt_in)
get_n(toy_dgirt_in)

# respondent count by year
get_n(toy_dgirt_in, by = "year")

# respondent count by year and survey identifier
get_n(toy_dgirt_in, by = c("year", "source"))

data(toy_dgirt_in)
get_item_n(toy_dgirt_in)
get_item_n(toy_dgirt_in, by = "year")
# }

Run the code above in your browser using DataLab