19

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.
sbha
  • 9,802
  • 2
  • 74
  • 62
eyama
  • 303
  • 2
  • 6

7 Answers7

9

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.

R. Angi
  • 196
  • 1
  • 6
  • I did not understand how to use your solution. I updated tidyverse Today and everything became a complete mess in my code :( – JPV Oct 25 '18 at 23:50
  • I have the same problem :( which version of rlang did you use? thanks! – Ferand Dalatieh Oct 30 '18 at 13:34
  • I ended up using version `0.1.6` and didn't have any issues Additional documentation on the `0.3.0` update can be found here https://cran.r-project.org/web/packages/rlang/news/news.html – R. Angi Nov 01 '18 at 10:30
4

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)
garciparedes
  • 1,749
  • 2
  • 18
  • 34
  • 1
    Have you tried working with this solution? It appears not to e working on my side – Confusion Matrix Nov 08 '18 at 09:41
  • 1
    This worked on my computer. It took awhile because of the number of packages I have. – user41509 Nov 13 '18 at 18:58
  • @ConfusionMatrix it worked in my case. The fact is that reinstalling all packages the incompatibilities between package versions were fixed. That was the reason in my case. – garciparedes Nov 18 '18 at 09:30
  • 1
    @garciparedes it worked but I did something else in addition to what you suggested. I had to manually update some packages to avoid conflicts. – Confusion Matrix Nov 22 '18 at 06:46
2

Problem happened after installing new version of RStudio-1.2.1114.exe

To solve this problem I just had to install package 'dplyr' again

install.packages("dplyr")  
vlad1490
  • 355
  • 2
  • 8
1

What worked for me (though to be honest I don't fully understand why):

1) Delete the rlang folder from the computer (on Windows: R/win-library/3.4)
2) install.packages("dplyr")

In the two cases where I encountered this problem, the system was operating on R 3.4 with Windows. It's possible that the R3.4/Windows had something to do with it.

Mirabilis
  • 471
  • 3
  • 6
  • 1
    On ubuntu 16, R. 3.4.4. Just updating dplyr with `install.packages("dplyr")` fixed it for me. I did _not_ delete the rlang folder. – Ott Toomet Nov 05 '18 at 22:35
  • I do not have a "win-lib" folder in my R folder... anywhere else it might be? – trisaratops Nov 09 '18 at 20:32
  • It's actually win-library (sorry about the mistake). I'll update my original response to reflect that. You can check where your packages are installed by running `path.package("PKG_NAME")` – Mirabilis Nov 10 '18 at 21:06
0

I temporarily solved the problem via downgrading rlang.

require(devtools)
install_version("rlang", version = "x.x.x", repos = "http://cran.us.r-project.org")

x.x.x: the version you need


I just realize that "dplyr" has fixed the issue after version 0.7.4.

X. Steiner
  • 13
  • 3
0

For what it's worth, it worked for me by doing this:

  1. having dplyr version 0.7.8
  2. having rlang version 0.3.0.9000

I have R version 3.4.3 and using Rstudio version 1.1.456.

skhan8
  • 121
  • 4
-3

Try the following command: This will bring rlang to version 0.2.1

Post this you will be able to run the command.