check_column_name

check_column_name(df, column.name)

Arguments

df

A data frame.

column.name

new column name

Value

A column name

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

df <- 
  data.frame(x = 1:2, y = 2:3, y.1 = 3:4)
df
#>   x y y.1
#> 1 1 2   3
#> 2 2 3   4

check_column_name(df = df, column.name = "y")
#> [1] "y.2"
check_column_name(df = df, column.name = "y.1")
#> [1] "y.1.2"