0

I like to use R to analyse data but I don't know how to escape these things in R. Can someone help me? Thanks in advance. How can I handle with these columns?

1 Answers1

0

Maybe it is easier to use the clean_names() function from the janitor package.

library(dplyr)
library(janitor)

my_df
#> # A tibble: 10 x 2
#>    `xGD/90` `Pts/G`
#>       <dbl>   <dbl>
#>  1     2.10    4.38
#>  2     4.93    5.35
#>  3     3.13    2.99
#>  4     4.66    4.50
#>  5     3.05    4.26
#>  6     4.32    5.26
#>  7     3.44    3.87
#>  8     5.44    3.96
#>  9     5.06    4.28
#> 10     4.37    4.67
my_df %>% 
    clean_names()
#> # A tibble: 10 x 2
#>    x_gd_90 pts_g
#>      <dbl> <dbl>
#>  1    2.10  4.38
#>  2    4.93  5.35
#>  3    3.13  2.99
#>  4    4.66  4.50
#>  5    3.05  4.26
#>  6    4.32  5.26
#>  7    3.44  3.87
#>  8    5.44  3.96
#>  9    5.06  4.28
#> 10    4.37  4.67

Then you can can use whatever function

Created on 2021-06-07 by the reprex package (v2.0.0)

Samuel Calderon
  • 641
  • 3
  • 13