26 is not a viable column name in a data.frame, so its not clear how you got here.
But if you are using dplyr::rename, the new name should be on the left with the old on the right:
a_frame <- data.frame(a1=c(1,2,3))
# fine
b_frame <- data.frame(2=c(1,2,3))
# error
c_frame <- data.frame(`2`=c(1,2,3))
names(c_frame)
#fine but got auto renamed to X2
> names(c_frame)
[1] "X2"
rename(c_frame, Jan=X2)
#now its called Jan
```r
to share 20 records from your data try:
dput(head(Clean_AIM9X,n=20))
and paste the results but use a line of 3 backticks to make it format in the post
I could read in my own excel files, but I doubt that would help you.
if you don't (for whatever reason) feel up to running dput() as suggested you could read names, to now for sure what the names are...
names(EQM_Data)
also, EQM_Data is not Clean_AIM9X, so I guess its a recurring issue for you.
the names function showed me the specific names, there are a bunch of decimals involved, I will work on it after lunch and let you know how it goes. Thank you!
Okay, so i used the name function to return names and it showed me that the variable names are ...8, etc and not just 8. However, when i use the rename function from deplyr with these variables it still returns me the same error about positive column indexes in '[' must match number of columns. Sadly i cannot share with you guys the exact data i am using, but i will work to get a example that is not proprietary information.
probably a nice and simple approach for you would be to decide on a list of names (in order of the position of the column) and just set the names(mydf) <- mylistofnames
to change it
type ?names in the console to see examples in the help