After successfully installing tidyverse with all its dependencies, when loading the package, the following error is given. How can I fix this?
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’:
.onAttach failed in attachNamespace() for 'tidyverse', details:
call: if (theme$dark) crayon::white(x) else crayon::black(x)
error: missing value where TRUE/FALSE needed
UPDATE: I was recommended to move this to here. UPDATE: If R GUI is used instead of R Studio, tidyverse loads without a problem. The issue is when library(tidyverse) gives an error when used in R Studio.
Yes. The issue is not that tidyverse is not installed. If I go to R GUI (not R Studio), loading tidyverse would work. The issue is that library(tidyverse) will give the error shown above if you want to load it in R Studio.
Some of my students have seen that this week. It seems to be connected with tidyverse 1.2.0. The solution I found was to go back into the past (rather than forward into the future): find the .tar.gz of 1.1.1, download it, then something like
f=file.choose() # to find the file on the user's system (eg. Downloads)
install.packages(f,repos=NULL) # use the one downloaded rather than get it from anywhere
This last runs disturbingly quickly and silently, but when I've done it, it seems to work.
@dd_rookie, that's what I was expecting to see. Can you try selecting an "Editor theme" in the Appearance options (I think TextMate should match your current theme), and then see if you can load the 1.2.0 version of tidyverse? It looks like your theme was somehow deselected.
@cavusogh, it's possible that your theme got properly set when you checked the options? You may be able to load the new tidyverse version now, since getThemeInfo()$dark isn't NULL.
Thanks @nick. Now, it seems to work well, after I switched to TextMate. And the getThemeInfo()$dark is no longer NULL.
I'm, finally, relieved to see the usual conflicts and warning messages :
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
Warning messages:
1: package ‘tidyr’ was built under R version 3.4.2
2: package ‘purrr’ was built under R version 3.4.2
3: package ‘dplyr’ was built under R version 3.4.2
4: package ‘forcats’ was built under R version 3.4.2
Glad to hear that fixed the problem. This would appear to be an issue with rstudioapi (that the theme can be NULL) that would have to be worked around in tidyverse. The problem is reproducing it, since I doubt it would occur on a fresh install.
I'm not able to reproduce it on my machine, but I ran a workshop with >40 people mostly new installations of R, RStudio (on Wednesday), and more than half of the attendees had this error crop up. Workaround by loading packages individually.
I can also reproduce this error. installing dev versions of rstudioapi, crayon, tidyverse all have no effect. Simply choosing a color theme in the RStudio global options menu (e.g. re-selecting the default theme) fixes this for me.
Glad to hear re-choosing a theme worked. I filed an issue under rstudioapi for the problem (and an associated one for tidyverse), but that doesn't help people trying to use it right now.
@atiretoo, if you have any more workshops before the next version of the tidyverse package is released, I've listed some solutions to the problems we've seen on this forum at this umbrella post.