How do you get the length of a variable. I am trying to get the last character of factor but the width/length of the contents is variable.
I was trying to do something like this:
newvariable <- substr(oldvariable, length(oldvariable) -1, length(oldvariable))