I have 10 objects eg1, eg2, eg3....eg10 that I want to see using the View() function in R. I have a feeling that I can write a simple code that would run View(egi) with i from 1 to 10, but I'm not sure how I could write this in R. Can anyone give me some advice?
I would suggest Map, like this:
eg1 <- eg2 <- eg3 <- data.frame(matrix(1:4, ncol = 2))
egs <- mget(ls(pattern = "^eg"))
Map(View, egs, names(egs))
Wrap it in invisible before running it if you don't want all those pesky NULLs in your console.
Proof :-)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With