'Filtering out all the rows before "X" happens

I have a list of data frames and I'm trying to filter out all the rows before certain characters appear in the column Z (all the rows before that are "NA"). I tried the code

for(i in 1:length(list_of_df)){
list_of_df[[i]] <- list_of_df[[i]] %>% dplyr::slice(which.max(list_of_df[[i]]$Z == "NA")) : n()
}

but for some reason I get

Error in UseMethod("slice") : 
  no applicable method for 'slice' applied to an object of class "c('integer', 'numeric')"

What's going on here and how could I fix the problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source