I am working on something where I need to edit the line numbers of the lint() output; a natural way to do that is like so:
l <- lint(...)
l <- lapply(l, within, line_number <- line_number + 1)
But this fails because within attempts to dispatch on lints class. For now, we need to call the method explicitly:
l <- lapply(l, within.list, line_number <- line_number + 1)
We could also define a within.lints() method, but that only works for this specific case, I think the problem is more general (it will affect other generics used too process the lint() output, too).
I am working on something where I need to edit the line numbers of the
lint()output; a natural way to do that is like so:But this fails because
withinattempts to dispatch onlintsclass. For now, we need to call the method explicitly:We could also define a
within.lints()method, but that only works for this specific case, I think the problem is more general (it will affect other generics used too process thelint()output, too).