Remove prefices from column names.

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

x <- data.frame(main.temp = 1:10, sys.msg = "OK", cnt = 10:1) names(x)
#> [1] "main.temp" "sys.msg" "cnt"
remove_prefix(x, c("main", "sys")) %>% names()
#> [1] "temp" "msg" "cnt"