#Use gregexpr() to obtain a list called "atsign", which shows the starting positions and length of the usernames associated with the "@" symbol in the "text" column. #Review the "atsign" list and identify the smallest row number that contains "@" symbols with a length greater than 2 and tell me the row number with loop.
library(stringr) atsign <- gregexpr("@", df$text) for (i in 1:20) { if (atsign[[i]] > 2) { print(i) } }