I have a data frame like this:
dataset <- data.frame(COL1 = c(1,2,3,4), COL2 = c(4,3,2,1))
I'm then trying to order it like so:
dataset <- dataset[order(-COl1),]
However, this results in an error because apparently COL1 doesn't exist:
Error in order(-COl1) : object 'COl1' not found
If I change the declaration of the dataset to:
dataset <- data.frame(COL1 <- c(1,2,3,4), COL2 <- c(4,3,2,1))
It works fine! However, the problem is that the dataset declaration is generated by another program so i cannot change it. Is there a way to re-declare the data set in a way that will allow me to order it properly?