0

我有一个使用 renv 的 R 项目。但是,我已经有一段时间忽略了拍摄任何快照,现在我收到了一些我不知道如何处理甚至开始制作可重复示例的神秘消息。任何想法,因为我在运行时收到以下错误消息renv::status()

> renv::status()
Error in !deps$Dev : invalid argument type
In addition: Warning messages:
1: In substring(u, so, so + ml - 1L) : invalid multibyte string, element 1
2: In substring(u, so, so + ml - 1L) : invalid multibyte string, element 1
Traceback (most recent calls last):
21: renv::status()
20: renv_status_impl(project, libpaths, lockpath, cache)
19: renv_status_check_missing_library(project, libpaths)
18: snapshot(project = project, library = libpaths, lockfile = NULL, 
        force = TRUE)
17: renv_lockfile_create(project, libpaths, type, packages)
16: renv_snapshot_r_packages(libpaths = libpaths, project = project) %>% 
        renv_snapshot_filter(project = project, type = type, packages = packages) %>% 
        renv_snapshot_fixup()
15: eval(call, envir = parent.frame())
14: eval(call, envir = parent.frame())
13: renv_snapshot_fixup(renv_snapshot_r_packages(libpaths = libpaths, 
        project = project) %>% renv_snapshot_filter(project = project, 
        type = type, packages = packages))
12: renv_snapshot_fixup_renv(records)
11: renv_snapshot_r_packages(libpaths = libpaths, project = project) %>% 
        renv_snapshot_filter(project = project, type = type, packages = packages)
10: eval(call, envir = parent.frame())
 9: eval(call, envir = parent.frame())
 8: renv_snapshot_filter(renv_snapshot_r_packages(libpaths = libpaths, 
        project = project), project = project, type = type, packages = packages)
 7: renv_snapshot_filter_implicit(project, records)
 6: renv_snapshot_filter_impl(project, records, project)
 5: renv_snapshot_dependencies(project, source)
 4: withCallingHandlers(dependencies(path = source, root = project, 
        progress = FALSE, errors = errors), renv.dependencies.error = renv_dependencies_error_handler(message, 
        errors))
 3: dependencies(path = source, root = project, progress = FALSE, 
        errors = errors)
 2: deps[!deps$Dev, ]
 1: `[.data.frame`(deps, !deps$Dev, )

这与我跑步时的消息相同renv::snapshot()

> renv::snapshot()
Error in !deps$Dev : invalid argument type
In addition: Warning messages:
1: In substring(u, so, so + ml - 1L) : invalid multibyte string, element 1
2: In substring(u, so, so + ml - 1L) : invalid multibyte string, element 1
Traceback (most recent calls last):
18: renv::snapshot()
17: renv_lockfile_create(project, libpaths, type, packages)
16: renv_snapshot_r_packages(libpaths = libpaths, project = project) %>% 
        renv_snapshot_filter(project = project, type = type, packages = packages) %>% 
        renv_snapshot_fixup()
15: eval(call, envir = parent.frame())
14: eval(call, envir = parent.frame())
13: renv_snapshot_fixup(renv_snapshot_r_packages(libpaths = libpaths, 
        project = project) %>% renv_snapshot_filter(project = project, 
        type = type, packages = packages))
12: renv_snapshot_fixup_renv(records)
11: renv_snapshot_r_packages(libpaths = libpaths, project = project) %>% 
        renv_snapshot_filter(project = project, type = type, packages = packages)
10: eval(call, envir = parent.frame())
 9: eval(call, envir = parent.frame())
 8: renv_snapshot_filter(renv_snapshot_r_packages(libpaths = libpaths, 
        project = project), project = project, type = type, packages = packages)
 7: renv_snapshot_filter_implicit(project, records)
 6: renv_snapshot_filter_impl(project, records, project)
 5: renv_snapshot_dependencies(project, source)
 4: withCallingHandlers(dependencies(path = source, root = project, 
        progress = FALSE, errors = errors), renv.dependencies.error = renv_dependencies_error_handler(message, 
        errors))
 3: dependencies(path = source, root = project, progress = FALSE, 
        errors = errors)
 2: deps[!deps$Dev, ]
 1: `[.data.frame`(deps, !deps$Dev, )

谢谢 :)

4

1 回答 1

0

事实证明,重新启动 RStudio 后问题自行解决了!

于 2021-06-29T15:55:49.490 回答