I want to find 5 digit numbers that have four 5s. I do the following:
data <- str_split(as.character(x = 10000:99999), pattern = "")
but when I try to find the number of lists that contain four 5s
sapply(data, function(x) c("5", "5", "5", "5") %in% data[[x]])
it gives me an error "Error in data[[x]] : no such index at level 1":
What am I doing wrong? any other more elegant solution?