make_column_classes: A function to provide default names for columns and ensure...

Description Usage Arguments Value

View source: R/column_functions.R

Description

A function to provide default names for columns and ensure that every column has a name

Usage

1
make_column_classes(n_cols, col_classes = NULL, partial_classes = TRUE)

Arguments

n_cols

numeric. Number of columns in the data

col_classes

character vector with classes to be assumed for the columns. Currently, the following classes are allowed: “character”, “numeric”, “integer”, “logical”, “factor”. Additionally, one may use “asis”, if the class of a column should not be changed. If the class for a column is not specified explicitly, “asis” will be assumed.

partial_classes

logical. If TRUE, the first seven columns will receive default classes:

+ subject - factor + md5_hash, controller, type, item - character (notice that in Ibex items can be identified with character strings, that's why item is not numeric by default), + presentation_order, element_number - numeric,

So col_names will be taken to specify classes for columns starting from 8. If FALSE, col_classes will be taken as specifying classes for all columns. If there are less than 8 columns, partial classes will always be taken to be FALSE.

Value

vector with column classes


antonmalko/ibextor documentation built on May 25, 2019, 2:26 p.m.