Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205904

variable text contains multiple patterns

$
0
0

I need to know if the match variable is contained in the url variable:

df1 = data.frame(match  = c("2234436803329252","460696711422302"), stringsAsFactors = F)

df2 = data.frame(url = c("https://business.facebook.com/460696711422302/", "https://twitter.com/status/1192745040302477312"),stringsAsFactors = F)

df1 %>% mutate(is_in_url = str_detect(df1$match,fixed(df2$url,ignore_case = T )

It returns a vector c(FALSE, FALSE), but "https://business.facebook.com/460696711422302/" contains "460696711422302". Are there resources with dplyr and stringr libraries?


Viewing all articles
Browse latest Browse all 205904

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>