trim_prefix {volker}R Documentation

Remove a prefix from a character vector or a factor

Description

If the resulting character values would be empty, the prefix is returned. At the end, all items in the vector are trimmed using trim_label.

Usage

trim_prefix(x, prefix = TRUE)

Arguments

x

A character or factor vector.

prefix

The prefix. Set to TRUE to first extract the prefix.

Details

If x is a factor, the order of factor levels is retained.

Value

The trimmed character or factor vector.


[Package volker version 3.0.0 Index]