How to handle non-standard column names in R when using `dplyr::select()`?
I'm trying to figure out I'm optimizing some code but I've searched everywhere and can't find a clear answer. This might be a silly question, but I'm having trouble selecting columns in a data frame where some of the column names contain spaces and special characters. Specifically, I'm working with a data frame created from a CSV file that has column names like `"Column 1@Value"` and `"Sales#2023"`. When I try to select these columns using `dplyr::select()`, I get an behavior. Hereโs what Iโve tried: ```r library(dplyr) # Sample data frame my_data <- data.frame(`Column 1@Value` = c(1, 2), `Sales#2023` = c(100, 150)) # Attempting to select columns selected_data <- my_data %>% select(`Column 1@Value`, `Sales#2023`) ``` This code throws an behavior: ``` behavior in select(., `Column 1@Value`, `Sales#2023`) : unused argument (Column 1@Value) ``` Iโve also tried using `contains()` and `matches()` functions, but with no success. Iโm currently using R version 4.3.1 and the latest version of `dplyr`. Is there a best practice for dealing with these non-standard column names in `dplyr`? Any help would be appreciated! This is part of a larger application I'm building. I'm working on a API that needs to handle this. My development environment is Windows. Am I missing something obvious? Thanks, I really appreciate it! I'm on Windows 10 using the latest version of R.