0

I am fairly new to R and have been completing the Swirl course to better my basic understanding. When moving onto the intermediate lessons I encountered a problem downloading the tidyverse package. I first of all downloaded Rtools using:

writeLines('PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"', con = "~/.Renviron"

to compile the package properly. I have tried using:

install.packages("tidyverse")

install.packages("tidyverse", dependencies = TRUE)

I have done this multiple times and get this code message:

Installing package into ‘C:/Users/lmck0/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyverse_1.3.0.zip'
Content type 'application/zip' length 439983 bytes (429 KB)
downloaded 429 KB

package ‘tidyverse’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\lmck0\AppData\Local\Temp\RtmpY5tVDF\downloaded_packages

I then use library(tidyverse) and get this code message:

Error: package or namespace load failed for ‘tidyverse’:
 .onAttach failed in attachNamespace() for 'tidyverse', details:
  call: namespaceExport(ns, exports)
  error: undefined exports: addTheme, applyTheme, as.document_position, as.document_range, askForPassword, askForSecret, bugReport, buildToolsCheck, buildToolsExec, buildToolsInstall, callFun, convertTheme, createProjectTemplate, dictionariesPath, documentClose, documentNew, documentSave, documentSaveAll, document_position, document_range, executeCommand, findFun, getActiveDocumentContext, getActiveProject, getConsoleEditorContext, getPersistentValue, getRStudioPackageDependencies, getSourceEditorContext, getThemeInfo, getThemes, getVersion, hasColorConsole, hasFun, highlightUi, initializeProject, insertText, is.document_position, is.document_range, isAvailable, jobAdd, jobAddOutput, jobAddProgress, jobRemove, jobRunScript, jobSetProgress, jobSetState, jobSetStatus, launcherAvailable, launcherConfig, launcherContainer, launcherC
In addition: Warning messages:
1: S3 methods ‘as.document_position.default’, ‘as.document_position.document_position’, ‘as.document_range.default’, ‘as.document_range.document_range’, ‘format.document_position’, ‘format.document_range’, ‘primary_selection.document_context’, ‘primary_selection.document_selection’, ‘print.document_context’, ‘print.document_position’, ‘print.document_range’, ‘print.document_selection’ were declared in NAMESPACE but not found 
2: S3 methods ‘as.document_position.default’, ‘as.document_position.document_position’, ‘as.document_range.default’, ‘as.document_range.document_range’, ‘format.document_position’, ‘format.document_range’, ‘primary_selection.document_context’, ‘primary_selection.document_selection’, ‘print.document_context’, ‘print.document_position’, ‘print.document_range’, ‘print.document_selection’ were declared in NAMESPACE but not found 
3: S3 methods ‘as.document_position.default’, ‘as.document_position.document_position’, ‘as.document_range.default’, ‘as.document_range.document_range’, ‘format.document_position’, ‘format.document_range’, ‘primary_selection.document_context’, ‘primary_selection.document_selection’, ‘print.document_context’, ‘print.document_position’, ‘print.document_range’, ‘print.document_selection’ were declared in NAMESPACE but not found 

I have also tried uninstalling Rstudio and Rtools and reinstalling them multiple times as well and nothing seems to be working and I am unable to continue with the Swirl course.

I was just wondering if anyone had run into the same problems or if I am missing something...

Any help would be much appreciated!

Phil
  • 7,287
  • 3
  • 36
  • 66
  • You should try asking this on the community Rstudio board. https://community.rstudio.com/ You also don't need to install Rtools in order to use or install the tidyverse meta package or its suite of packages. – Phil Jun 01 '20 at 15:28
  • If you would like to fully uninstall then reinstall R and RStudio, follow the steps here: https://stackoverflow.com/a/61187094/1953250 – ozturkib Jun 09 '20 at 08:59
  • I ended up solving the issue by closing and re-opening Rstudio, followed by: install.packages(“rstudioapi”), before installing and reloading tidyverse again! Thanks for your help. – Lauren McKenzie Jun 17 '20 at 11:11

0 Answers0