I have a simple Spark data frame strings and I cannot filter it by using the str_count function in the stringr package. For example:
> library(stringr)
> df = data.frame(long=c("AA", "BB"), short=c("A", "B"))
> df
long short
1 AA A
2 BB B
> sdf = as.DataFrame(df)
> filter(sdf, str_count(sdf$long, "A") == 2)
Error in if (length(string) == 0) return(character()) :
argument is not interpretable as logical
I suspect there is some problem with the type conversions but I cannot find a solution. The subset function and the "array selection" notation fail as well.
Thanks in advance