dropColsInDF: dropColsInDF

Description Usage Arguments Value Examples

View source: R/wagnertimoR.R

Description

This function removes columns from a given data.frame. The columns have to be in a vector.

Usage

1
dropColsInDF(df, namesVector)

Arguments

df

- a data.frame

namesVector

- the vector (c()) with the names of data.frame which should be dropped.

Value

the given data.frame without the variables (columns) in the namesVector.

Examples

1
2
df <- data.frame(age = c(16,20,19), name = c("Tim", "Anne", "Mike"), weight = c(75,51,80), height = c(182,164,188))
df.new <- dropColsInDF(df, c("weight", "height"))

wagnertimo/wagnertimoR documentation built on May 3, 2019, 7:37 p.m.