Skip to content
Prev 389131 / 398506 Next

Evaluating lazily 'f<-' ?

I think you're trying to do something like:

`padding<-` <- function (x, which, value)
{
    which <- match.arg(which, c("bottom", "left", "top", "right"),
several.ok = TRUE)
    # code to pad to each side here
}

Then you could use it like

df <- data.frame(x=1:5, y = sample(1:5, 5))
padding(df, "right") <- 1

Does that work as expected for you?

On Mon, Sep 13, 2021, 11:28 Leonard Mada via R-help <r-help at r-project.org>
wrote: