Skip to content

Instantly share code, notes, and snippets.

View eyayaw's full-sized avatar

Eyayaw Beze eyayaw

View GitHub Profile
@moodymudskipper
moodymudskipper / subset_to_end.R
Created December 18, 2021 18:40
subset to end
`[` <- function(x, ...) {
base::`[`(x, ...)
}
makeActiveBinding(".I", function() {
sc <- sys.calls()
fr <- which(vapply(sc, \(x) capture.output(x)[1], character(1)) == "base::`[`(x, ...)")
fr <- fr[length(fr)]
sf <- sys.frames()[[fr-1]]
x <- eval(quote(x), sf)