keepColsInDF: keepColsInDF

Description Usage Arguments Value Examples

View source: R/wagnertimoR.R

Description

This function only keeps the columns of a given data.frame from a specified namesVector.

Usage

1
keepColsInDF(df, namesVector)

Arguments

df

- a data.frame

namesVector

- the vector (c()) with the names of data.frame which will be kept.

Value

the given data.frame only with 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 <- keepColsInDF(df, c("name"))

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