In R, suppose I have a vector like:
vector<-c("Red", " ", "", "5", "")
I want to count how many elements of this vector are just empty strings that only consist of either spaces or no spaces at all. For this very short vector, it just three. The second, third, and fifth elements are just spaces or no spaces at all. They don’t have any characters like letters, numbers, symbols, etc.
Is there any function or method that will count this? I wanted something I could use on larger vectors rather than just looking at every element of the vector.