substract_prefix_from_all_column: substract_prefix_from_all_column

Description Usage Arguments Details Value Examples

View source: R/prefix_operation.R

Description

Subtracts the indicated prefix from all the columns of the dataframe.

Usage

1

Arguments

dataframe

data.frame. The dataframe from which the column prefixes must be removed.

prefix

string. The prefix to subtract from column names.

Details

substract_prefix_from_all_column subtracts the specified prefix from all the columns of the dataframe and returns a new dataframe.

Value

returns a new dataframe identical but without prefix to the column names.

Examples

1
2
3
4
5
6
A_Column1 <- c(1, 2)
A_Column2 <- c(3, 4)
A_Column3 <- c(5, 6)
df <- data.frame(A_Column1, A_Column2, A_Column3)

newdf <- substract_prefix_from_all_column(df, "A_")

JeremyGillard/somar documentation built on March 19, 2021, 10:50 a.m.