fix_special_characters_in_names {fixr}R 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)


[Package fixr version 0.1.0 Index]