0
votes

I am trying to load code into a notebook in Watson Studio Cloud. HOwever, when I try to install packages and then make the library call I get the error below. Does anyone know how I can resolve this? I thought I had it taken care of earlier in the week but it keeps coming up each day.

Also, if I am in Watson Studio do you know of a way to store packages so I don't have to install each time a new kernel starts.

install.packages("Rcpp", dependencies = TRUE,repos = "https://cloud.r-project.org")
install.packages("rvest", dependencies = TRUE,repos = "https://cloud.r-project.org")
install.packages("dplyr",dependencies = TRUE, repos = "https://cloud.r-project.org")
install.packages("qdap",dependencies = TRUE, repos = "https://cloud.r-project.org")
install.packages("stringdist",dependencies = TRUE, repos = "https://cloud.r-project.org")
install.packages("htmltab",dependencies = TRUE, repos = "https://cloud.r-project.org")
install.packages("edgar",dependencies = TRUE, repos = "https://cloud.r-project.org")
install.packages("tidytext",dependencies = TRUE, repos = "https://cloud.r-project.org")

library(Rcpp) library(rvest) library(dplyr) library(stringr) library(qdap) library(stringdist) library(htmltab) library(edgar) library(stringi) library(tidytext)

Error in value[3L]: Package ‘Rcpp’ version 0.12.13 cannot be unloaded: Error in unloadNamespace(package) : namespace ‘Rcpp’ is imported by ‘xml2’ so cannot be unloaded

Traceback:

  1. library(Rcpp)
  2. tryCatch(unloadNamespace(package), error = function(e) { . P <- if (!is.null(cc <- conditionCall(e))) . paste("Error in", deparse(cc)[1L], ": ") . else "Error : " . stop(gettextf("Package %s version %s cannot be unloaded:\n %s", . sQuote(package), oldversion, paste0(P, conditionMessage(e), . "\n")), domain = NA) . })
  3. tryCatchList(expr, classes, parentenv, handlers)
  4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
  5. value[3L]
  6. stop(gettextf("Package %s version %s cannot be unloaded:\n %s", . sQuote(package), oldversion, paste0(P, conditionMessage(e), . "\n")), domain = NA)
1

1 Answers

0
votes

I was installing packages that were already installed by the admin of the cloud account. This was causing conflicts.

I used find.package to locate existing packages already installed and when one was not found I installed it.

No further issues.