Closed Lisaksimon closed 3 years ago
Ok, so I cannot reproduce the error you face!
This could be a good news, meaning it's just about updating packages. I suspect in particular you are using an old version of broom
? Can you please run packageVersion("broom")
first, then update it (install.packages("broom")
or all with update.packages(ask=FALSE)
) and then re-run the reprex below? Note there will be new warnings (I need to update the code) but the code should run at least!?
devtools::source_url("https://raw.githubusercontent.com/MatthieuStigler/Misconometrics/master/Gelbach_decompo/dec_covar.R")
#> SHA-1 hash of file is ed716e821f7d61a45b36cedc16d1ed1be3abb046
#> Error in bindingIsLocked(x, ns): no binding for "process_lm"
library(tidyverse)
model_full_1 <- lm(Fertility ~ ., data=swiss)
dec <- dec_covar(object = model_full_1, var_main = "Education")
#> Warning: `funs()` is deprecated as of dplyr 0.8.0.
#> Please use a list of either functions or lambdas:
#>
#> # Simple named list:
#> list(mean = mean, median = median)
#>
#> # Auto named with `tibble::lst()`:
#> tibble::lst(mean, median)
#>
#> # Using lambdas
#> list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_warnings()` to see where this warning was generated.
packageVersion("broom")
#> [1] '0.7.0'
packageVersion("dplyr")
#> [1] '1.0.2'
Created on 2020-10-11 by the reprex package (v0.3.0)
So just updated all my packages - bad new is that now neither plm nor lm works anymore. I do get the exact same error message as you now replicating the above - but the code does not run, it stops at the errors..
devtools::source_url("https://raw.githubusercontent.com/MatthieuStigler/Misconometrics/master/Gelbach_decompo/dec_covar.R")
#> SHA-1 hash of file is ed716e821f7d61a45b36cedc16d1ed1be3abb046
#> Error in bindingIsLocked(x, ns): no binding for "process_lm"
library(tidyverse)
library(reprex)
model_full_1 <- lm(Fertility ~ ., data=swiss)
dec <- dec_covar(object = model_full_1, var_main = "Education")
#> Warning: `funs()` is deprecated as of dplyr 0.8.0.
#> Please use a list of either functions or lambdas:
#>
#> # Simple named list:
#> list(mean = mean, median = median)
#>
#> # Auto named with `tibble::lst()`:
#> tibble::lst(mean, median)
#>
#> # Using lambdas
#> list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_warnings()` to see where this warning was generated.
packageVersion("broom")
#> [1] '0.7.1'
packageVersion("dplyr")
#> [1] '1.0.2'
Created on 2020-10-11 by the reprex package (v0.3.0)
Any ideas?
Oh I actually just updated my data.table package (which for some reason did not update, and now I get the same message, but the code runs, and plm() decomposition is back to running!
great! I'll have to clean those warnings at some point, but the important is it is working now!
Ok, I've cleaned and updated the code for the latest version of dplyr
, it should now run without issues. I'll close the issue, but feel free to re-open if there are still issues
Great. Thanks again for your quick help, it was a life saver last week!
From: Matthieu notifications@github.com Reply to: MatthieuStigler/Misconometrics reply@reply.github.com Date: Saturday, 17. October 2020 at 15:03 To: MatthieuStigler/Misconometrics Misconometrics@noreply.github.com Cc: Lisa Simon lisaksimon@gmail.com, Author author@noreply.github.com Subject: Re: [MatthieuStigler/Misconometrics] Bug when running lm() (#2)
Closed #2https://github.com/MatthieuStigler/Misconometrics/issues/2.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/MatthieuStigler/Misconometrics/issues/2#event-3889701739, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACR2FDUHDJBD7T7CYOIA7QDSLIIEFANCNFSM4SL5TU6Q.
Hi Matthieu,
as per email, here is the error I get when I try the decomposition with lm():
I get the same error when I do dec_covar on my linear model. While when I convert the data into panel data and use plm(), it works fine!
Thanks so much for looking into this. Created on 2020-10-11 by the reprex package (v0.3.0)