#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.
text <- c("I love @cats", "@Hi", "I love @dogs", "@Hi, how are you?", "@hi") atsign <- gregexpr("@", text) #examine the "atsign" list str(atsign) #create "length" list length <- unlist(lapply(atsign, length)) #extract the rows with the smallest row number that contains "@" symbols with a length greater than 2 and tell me the row number. text[which(length > 2 & length == min(length))]