Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Defunct as of rlang 0.3.0 and mutate_impl

Tags:

r

rlang

I am trying to use the following function but every time I do, I receive the error below. I tried installing an older version of rlang as it works on a different R Studio but I was unable to do that. It seems the error is due to the 0.3.0 version. Any suggestions on how to fix this error would be appreciated.

details2 <-
   details %>%
   mutate(rownames=rownames(.)) %>%
   filter(isdir==FALSE) %>%
   arrange(desc(ctime))

Error in mutate_impl(.data, dots) : 
  Evaluation error: `as_dictionary()` is defunct as of rlang 0.3.0.
Please use `as_data_pronoun()` instead.
like image 425
eyama Avatar asked Oct 23 '18 20:10

eyama


2 Answers

To solve this issue within a docker container, I ended up having to use devtools::install_version(..., dep = FALSE) to install an older version of rlang and manually install all dependencies for the packages I needed like dplyr.

Simply installing dplyr will install (or update) to the most recent version of rlang which released 0.3.0 on 2018-10-22 according to CRAN. Although I haven't figured out what changed with rlang and as_dictionary, this is a current workaround.

Although this was a pain, it did work. To find all imports for a particular package you can use as.data.frame(installed.packages()) and filter for the specific package name you are interested in. The column name is Imports.

Edit:
Although I have not tested it myself, another solution I found online is to upgrade dplyr to 0.7.7.

like image 96
R. Angi Avatar answered Sep 19 '22 07:09

R. Angi


I think the problem may come from incompatible package versions. You can try with:

update.packages(ask = FALSE, checkBuilt = TRUE)

If it doesn't work, reinstalling all packages the problem may disappear (code from here):

package_df <- as.data.frame(installed.packages())
package_list <- as.character(package_df$Package)
install.packages(package_list)
like image 20
garciparedes Avatar answered Sep 20 '22 07:09

garciparedes