I’m trying to use the billboard tibble in R to find all the songs titles that contain the word "Love" in them using string basics but I’m struggling.
The end result should look like this:
[1]"I'm Outta Love" "My First Love"
[3] "My Love Goes On And ..." "He Loves U Not"
[5] "Love Is Blind" "I Will Love Again"
[7] "Feels Like Love" "Let's Make Love"
[9] "My Love Is Your Love" "It Must Be Love"
[11] "He Can't Love U" "I Just Wanna Love U ..."
[13] "U Don't Love Me" "Don't Say You Love M..."
[15] "Love's The Only Hous..." "Because You Love Me"
[17] "Love Sets You Free" "I Knew I Loved You"
[19] "I Think I'm In Love ..." "Live, Laugh, Love"
[21] "The Chain Of Love"
>Solution :
data("billboard")
billboard$track[grepl("Love", billboard$track)]
# [1] "I'm Outta Love" "My First Love" "My Love Goes On And ..." "He Loves U Not" "Love Is Blind"
# [6] "I Will Love Again" "Feels Like Love" "Let's Make Love" "My Love Is Your Love" "It Must Be Love"
# [11] "He Can't Love U" "I Just Wanna Love U ..." "U Don't Love Me" "Don't Say You Love M..." "Love's The Only Hous..."
# [16] "Because You Love Me" "Love Sets You Free" "I Knew I Loved You" "I Think I'm In Love ..." "Live, Laugh, Love"
# [21] "The Chain Of Love"