RStudio unable to load tidyverse package - r

When loading the tidyverse package, the following error occurs:
Error: package or namespace load failed for ‘tidyverse’:
.onAttach failed in attachNamespace() for 'tidyverse', details:
call: switch(if (is.null(global)) "" else global, alternate = "Sky",
error: unused arguments (alternate = "Sky", default = "Modern")
I then tried to open R without Rstudio and loading tidyverse worked fine. I tried to unload/reload tidyverse and other things suggested here but none of them worked.
Characteristics
Rstudio version: RStudio 2022.02.2
R version: 4.2.0

Related

Error: package or namespace load failed for ‘CGPfunctions’ [duplicate]

I am getting the following error when I am loading a few libraries in R:
library(forecast)
Error : object ‘f_eval’ is not exported by 'namespace:lazyeval'
In addition: Warning message:
package ‘forecast’ was built under R version 3.3.2
Error: package or namespace load failed for ‘forecast’
library(tsoutliers)
Error : object ‘f_eval’ is not exported by 'namespace:lazyeval'
In addition: Warning message:
package ‘tsoutliers’ was built under R version 3.3.2
Error: package or namespace load failed for ‘tsoutliers’
I have tried reinstalling the packages but it didn't help. Also, I was able to use the forecast package previously but I started facing this error post the installation of tsoutliers package.
How can I resolve this issue?
This should do the job for you:
install.packages('lazyeval')
In the future, try and provide a bit more about your system and install, using the output from:
sessionInfo()

Install anomalize package in R

I have upgraded R version to R.3.6.2 and then installed tidyverse 1.3.0 Then I have installed anomalize package, but when I load anomalize it gives me this error:
Error: package or namespace load failed for ‘anomalize’:
.onAttach failed in attachNamespace() for 'anomalize', details:
call: NULL
error: Function getThemeInfo not found in RStudio
The OS is ubunto 18.04.3
Could you please let me know what is this problem and how I can fix it.

Running strapply in the absence of tcltk in R

I have a data frame with one column carrying a list variable. The list variable contains duplicate elements which I want to remove. The following is the code that I am using:
library(gsubfn)
Loading required package: proto
Could not load tcltk. Will use slower R code instead.
resp$secu <- as.character(lapply(strapply(resp[[7]], "\\w")), unique)
I am using R 3.2.0 version on mac. I tried loading tcltk manually without success:
library(tcltk)
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: X11 library is missing: install XQuartz from xquartz.macosforge.org
Error: package or namespace load failed for ‘tcltk’
I uninstalled library tcltk and tried re-installing but couldn't:
Warning in install.packages :
package ‘tcltk’ is not available (for R version 3.2.0)
I could execute the code and R started without any error messages. But it had taken an hour for a 65k row list to remove the duplicates and the processing yet to complete. Is there a way to improve the speed of strapply without using tcltk library?

Rcmdr Error : .onLoad failed in loadNamespace() for 'tcltk'

I have no idea what I'm doing but I need to use R and Rcmdr for my statistics class. I am running OS X 10.7.5, using 3.1.2 for R.
I have downloaded R.
install.packages("Rcmdr")
Picked a mirror, downloaded all packages. I then typed in
library(Rcmdr)
And received this error:
Loading required package: splines
Loading required package: RcmdrMisc
Loading required package: car
Loading required package: sandwich
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: system2("otool", c("-L", shQuote(DLL)), stdout = TRUE)
error: error in running command
Error: package or namespace load failed for ‘Rcmdr’
sh: otool: command not found
When I do:
capabilities("tcltk")
# [1] TRUE
Have I done something wrong?
The R developers have tried to make a workaround for R not giving a useful error message when Tcl/Tk was not fully supported on a Mac. It seems R 3.1.2 depends on the otool from Xtools for this. However, you can download a patched version of R from http://r.research.att.com/ to remove the error.

Unable to load caret package in R on R 3.1.0 on OSX 10.9

I installed the R caret package using install.packages command and did library(caret). I am recieving the following error
>library(caret)
Loading required package: lattice
Loading required package: ggplot2
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /usr/local/lib/libtcl8.6.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so
Reason: image not found
Error: package or namespace load failed for ‘caret’
I searched other posts and also installed OSX tcltk package from http://cran.us.r-project.org/bin/macosx/tools/ but it still does not seem to work. I also installed tcltk2 package from R but still does not work.. Kindly help
I have met the same problem with the same error message but unfortunately, just reinstalling R1.3 didn't solve the problem for me.
To solve it, I had to install X-Quartz as explained here in the "Mac OS X Trouble-shooting" section and the problems related to tcltk.
Do this and it will resolve the problem
install.packages("quantreg")
What version of R are you using? Do you use Mavericks? You may need to update to a version which includes Mavericks updates.
http://cran.r-project.org/bin/macosx/
I had the same issue. Reinstalling Quartz solved the issue
Try this, worked for me.
install.packages("caret", dependencies = T)
Once that is done, run
install.packages("pbkrtest", dependencies = T)

Resources