Lapply () with user input

Is there a way to use lapply() in a way that makes it wait for "enter" from the user before moving on to the next list item? If so, can you provide a simple example?

+4
source share
1 answer

Here is an example:

 es <- list(1, 2, 3) lapply(es, function(e) { cat("Press enter:") readLines(n = 1) print(e) }) 
+8
source