sumCertainCols: Sum certain columns

Description Usage Arguments Examples

View source: R/sumCertainCols.R

Description

Replaces all NAs with a specified replacement in a column that has "string" in its name

Usage

1
sumCertainCols(x, id.col = "Week", search.string, onlyTotal)

Arguments

x

data.table.

id.col

Character. ID column to index the output.

search.string

Character. A string that is in the target column name.

onlyTotal

Logical. TRUE = vector of summed columns, FALSE = column appended and returned with original data.table

Examples

1
2
3
sumCertainCols(data.table::data.table(iris), id.col = "Species", search.string = "Petal", onlyTotal = FALSE)

sumCertainCols(data.table::data.table(iris), id.col = "Species", search.string = "Petal", onlyTotal = TRUE)

Braja93/braja documentation built on June 1, 2017, 5:19 p.m.