【问题标题】:Error: processing vignette 'QuickStart.Rmd' failed with diagnostics: there is no package called 'utf8'错误:处理小插图“QuickStart.Rmd”诊断失败:没有名为“utf8”的包
【发布时间】:2020-09-19 06:20:55
【问题描述】:

我现在在 CRAN 上将包版本更新为 0.2.1。

做了之后,devtools::check_rhub(),报错说:

checking re-building of vignette outputs (1.9s)
   Error(s) in re-building vignettes:
     ...
   --- re-building 'QuickStart.Rmd' using rmarkdown
   Quitting from lines 74-75 (QuickStart.Rmd) 
   Error: processing vignette 'QuickStart.Rmd' failed with diagnostics:
   there is no package called 'utf8'
   --- failed re-building 'QuickStart.Rmd'
   
   SUMMARY: processing the following file failed:
     'QuickStart.Rmd'
   
   Error: Vignette re-building failed.
   Execution halted

我检查了第 74-75 行的代码

generate_ts(n.ts = 3, freq = 12, nComp = 2, n = 120, output_format = "tsibble")

我尝试在 vignette 中添加 library(utf8),然后我收到来自 devtools::check(cran=TRUE) 的错误说:

checking for unstated dependencies in vignettes ... NOTE
  'library' or 'require' call not declared from: 'utf8'

我尝试在 vignette 中添加 library(utf8) 和在 DESCRIPTION 中添加 utf8,但这进一步导致了错误

checking package dependencies ... ERROR
  
  The suggested packages are required for a complete check.
  Checking can be attempted without them by setting the environment
  variable _R_CHECK_FORCE_SUGGESTS_ to a false value.
  
  See section 'The DESCRIPTION file' in the 'Writing R Extensions'
  manual.

有人知道如何解决这个问题吗?

小插图中的其他代码

title: "Introduction to gratis"
author: "Bocong Zhao"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Introduction to gratis}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}

{r initial, echo = FALSE, cache = FALSE, results = 'hide'}
library(knitr)
opts_chunk$set(
  warning = FALSE, message = FALSE, echo = TRUE,
  fig.width = 7, fig.height = 6, fig.align = 'centre',
  comment = "#>"
)

{r, message=FALSE, include = FALSE}
library(forecast)
library(tsibble)
library(utf8)

【问题讨论】:

    标签: r package devtools cran


    【解决方案1】:

    来自本网站的参考答案,

    github.com/r-hub/rhub/issues/374

    运行此代码将解决问题devtools::check_rhub(env_vars=c(R_COMPILE_AND_INSTALL_PACKAGES = "always"))

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-29
      • 2020-11-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多