get the length/width of value in a factor

Posted by Brandon on Stack Overflow See other posts from Stack Overflow or by Brandon
Published on 2010-06-08T16:49:20Z Indexed on 2010/06/08 16:52 UTC
Read the original article Hit count: 212

Filed under:

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))

© Stack Overflow or respective owner

Related posts about r