I am trying to do some manipulation on the last column in a generic way.
I found here on the forums this nice piece of code that returns the name of the last columns:
tail(names(train),1) #returns [1] "last"
I still can't figure out how to reference directly to my dataset's last columns as:
data$last