I am using R and trying to combine two columns in a data frame into one column with both pieces of info. I have tried using the unite function and it has worked for me in the past, but it's giving me an error now and I'm not sure what I'm doing wrong.
unitedQualityCheck <- unite(QualityCheck, uSTAid, county, station, sep = ".", remove = FALSE, na.rm = FALSE)
QualityCheck is the name of my data, uSTAid is what I want to call the new column, the columns I want to combine are the county and station columns, and I want a period to separate the values inside the column. The head of my data is below, which shows the names of the columns are correct.
head(QualityCheck)
county RouteType station FactoredAADT HC_AADT_Future TDM_AADT_Future HC_TDM_AADT_Future SGR Rule3.4
1 4 127 1500 1800 4700 4700 10.67 NA 1800
When I run this code I get an error that says, "Error in [.data.frame
(x, x_vars) : undefined columns selected"
What am I doing wrong with this code? It worked for different data previously, but doesn't want to work now.