fix_special_characters_in_names: Remove Special Characters from Data Frame Column and Row...

View source: R/fix_special_characters_in_names.R

fix_special_characters_in_namesR Documentation

Remove Special Characters from Data Frame Column and Row Names

Description

This function removes any non-alphanumeric characters from both the row and column names of a given data frame.

Usage

fix_special_characters_in_names(df)

Arguments

df

A data frame with non-alphanumeric characters in the column or row names.

Value

A data frame with all non-alphanumeric characters removed from the column and row names.

Examples

df <- data.frame("Col1!" = c(1, 2, 3), "Col2?" = c(4, 5, 6))
rownames(df) <- c("Row1@", "Row2#", "Row3$")
fix_special_characters_in_names(df)


fixr documentation built on April 4, 2025, 12:30 a.m.