How count elements in an column that are not empty

count, r

Solution

If you want to count the strings that are not identical to the empty string (`""`), you can use:

sum(dat$exampleColumn != "")

Problem

I just started with R, and i have to count elements from an column that are not empty. For example : ``` exampleColumn 1 "heey" 2 3 "World" 4 "how are you " ``` How can I achieve this ?

Original source