Search code examples
rliststring-length

R: Extracting the length of characters within a large list


Large list

Is there a possibility to create a variable that captures the length of each chr string within a large list in R?

For example in from the picture above I would like to create a variable that captures that the first chr has a length of 0 the second one a length of 3, the third one a length of 4 and so on.

Thanks!


Solution

  • sapply(hunspell, length)
    

    This will apply the length function to each element of hunspell and return the result as a vector. Is that what you want?