Resetting the length of an object using if statement
I am doing web scraping. There is an if statement as follows
{if(length(title) == 0) NA else title}
Originally length of title is 12.
Now here I am confused over length function.
length(title)
gives me 12.
length(title)==0 g
ives me FALSE
.
So, putting length(title)==0
makes no sense because we already know that length of title is 12, then what's the point of putting it to 0.