Learn R Programming

nbastatR (version 0.1.110202031)

gather_data: Gather a data frame

Description

Gather a data frame

Usage

gather_data(data, variable_name = "item", numeric_ids = c("^id"),
  use_logical_keys = TRUE, use_factor_keys = TRUE, unite_columns = NULL,
  seperate_columns = NULL, use_date_keys = FALSE, remove_na = TRUE)

Arguments

data

a data_frame

variable_name

variable column name

numeric_ids

vector of numeric ids

use_logical_keys

if TRUE uses logicals as eys

use_factor_keys

if TRUE uses factors as a key

unite_columns

if not NULL list

  • new_column : new column name

  • column_1 : first column to unite

  • column_2 : second column to unite

  • sep : seperator

seperate_columns

if not NULL list

  • column : column to seperate

  • new_column_1 : new_column 1

  • new_column_2 : new_column 2

  • sep : seperator

use_date_keys

if TRUE uses dates as a key

remove_na

removes NA colums

unite_columns

if not NULL list

  • new_column : new column name

  • column_1 : first column to unite

  • column_2 : second column to unite

  • sep : seperator

seperate_columns

if not NULL list

  • column : column to seperate

  • new_column_1 : new_column 1

  • new_column_2 : new_column 2

  • sep : seperator

Value

a data_frame