Learn R Programming

owmr (version 0.8.2)

remove_prefix: Remove prefices from column names.

Description

Remove prefices from column names.

Usage

remove_prefix(data, prefices, sep = ".")

Arguments

data

data frame

prefices

vector of prefices to be removed from column names

sep

prefix separator

Value

data frame with updated column names

Examples

Run this code
# NOT RUN {
x <- data.frame(main.temp = 1:10, sys.msg = "OK", cnt = 10:1)
names(x)
remove_prefix(x, c("main", "sys")) %>% names()
# }

Run the code above in your browser using DataLab