Learn R Programming

insight (version 1.0.0)

text_remove_backticks: Remove backticks from a string

Description

This function removes backticks from a string.

Usage

text_remove_backticks(x, ...)

# S3 method for data.frame text_remove_backticks(x, column = "Parameter", verbose = FALSE, ...)

Value

x, where all backticks are removed.

Arguments

x

A character vector, a data frame or a matrix. If a matrix, backticks are removed from the column and row names, not from values of a character vector.

...

Currently not used.

column

If x is a data frame, specify the column of character vectors, where backticks should be removed. If NULL, all character vectors are processed.

verbose

Toggle warnings.

Examples

Run this code
# example model
data(iris)
iris$`a m` <- iris$Species
iris$`Sepal Width` <- iris$Sepal.Width
model <- lm(`Sepal Width` ~ Petal.Length + `a m`, data = iris)

# remove backticks from string
names(coef(model))
text_remove_backticks(names(coef(model)))

# remove backticks from character variable in a data frame
# column defaults to "Parameter".
d <- data.frame(
  Parameter = names(coef(model)),
  Estimate = unname(coef(model))
)
d
text_remove_backticks(d)

Run the code above in your browser using DataLab