melt_votes: Melt wide-formatted returns

Description Usage Arguments

Description

A wrapper for data.table::melt() in the common case where candidates are in columns and cells give votes.

Usage

1
2
3
melt_votes(.data, ..., na.rm = TRUE, value.name = "votes",
  variable.name = "candidate", variable.factor = FALSE,
  value.factor = FALSE)

Arguments

.data

A table of returns.

...

any other arguments to be passed to/from other methods.

na.rm

If TRUE, NA values will be removed from the molten data.

value.name

name for the molten data values column(s). The default name is 'value'. Multiple names can be provided here for the case when measure.vars is a list, though note well that the names provided in measure.vars take precedence.

variable.name

name for the measured variable names column. The default name is 'variable'.

variable.factor

If TRUE, the variable column will be converted to factor, else it will be a character column.

value.factor

If TRUE, the value column will be converted to factor, else the molten value type is left unchanged.


MEDSL/medslcleaner documentation built on May 31, 2019, 7:39 a.m.