[R] Unexpected interference between dplyr and plm

Sarah Goslee sarah.goslee at gmail.com
Tue Nov 29 20:31:28 CET 2016

On Tue, Nov 29, 2016 at 12:39 PM, David Winsemius
<dwinsemius at comcast.net> wrote:
> The other option would be to load dplyr first (which would give the waring that stats::lag was masked) and then later load plm (which should give a further warning that dplyr::lag is masked). Then the plm::lag function will be found first.

There isn't a plm::lag function; the desired function is stats::lag

It matters whether dplyr is loaded because that masks stats::lag().

It only matters whether plm is loaded because that package provides
the function that the original querent wanted to use lag() in the
context of.


Sarah Goslee

More information about the R-help mailing list