Reputation: 3663
A sample of my dataframe where the first line is the column title:
col1
some string
some other string
How do I make another column showing how long each of col1's strings are?
Upvotes: 1
Views: 6093
Reputation: 3663
Got it thanks to akrun's help:
df$col2 <- nchar(as.character(df$col1))
Upvotes: 5