0

我目前正在 jupyter notebook 上尝试 r 编程,我可以安装irkernel也可以安装r essentials.

我的问题是加载我已安装的任何软件包。

就像我会rstudio通过打字做的那样library(forecast)forecast包将被加载。

r jupyter它给了我错误消息,包不存在。

我该怎么做才能在 jupyter notebook 中加载我安装的 r 包?

编辑 即使我怀疑是否r-essentials安装了我要加载的 r 包,我也跑了

conda install r-forecast

以管理员身份在 anaconda 提示符下,我看到它已安装

我正在使用 Windows 10

编辑

查看我收到的错误消息

Error: package or namespace load failed for 'forecast':
 package 'lifecycle' was installed before R 4.0.0: please re-install it
Traceback:

1. library(forecast)
2. tryCatch({
 .     attr(package, "LibPath") <- which.lib.loc
 .     ns <- loadNamespace(package, lib.loc)
 .     env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
 . }, error = function(e) {
 .     P <- if (!is.null(cc <- conditionCall(e))) 
 .         paste(" in", deparse(cc)[1L])
 .     else ""
 .     msg <- gettextf("package or namespace load failed for %s%s:\n %s", 
 .         sQuote(package), P, conditionMessage(e))
 .     if (logical.return) 
 .         message(paste("Error:", msg), domain = NA)
 .     else stop(msg, call. = FALSE, domain = NA)
 . })
3. tryCatchList(expr, classes, parentenv, handlers)
4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
5. value[[3L]](cond)
6. stop(msg, call. = FALSE, domain = NA)
4

0 回答 0