5

我刚刚在公司的 Windows 64 位 PC 上安装了 Rstudio 1.0.44。当我试图制作任何情节时,我得到了这个错误:

Error in (function (filename = "Rplot%03d.png", width = 480, height = 480,  : invalid 'filename'

现在 Traceback 向我展示了以下信息:

8. stop("invalid 'filename'")
7. (function (filename = "Rplot%03d.png", width = 480, height = 480, units = "px", pointsize = 12, 
 bg = "white", res = NA, family = "sans", restoreConsole = TRUE,
 type = c("windows", "cairo", "cairo-png"), antialias = c("default", "none", "cleartype", "gray", "subpixel")) ...
6. do.call(what = png, args = args)
5. .rs.createNotebookGraphicsDevice(filename, height, width, units, pixelRatio, extraArgs)
4. (function () { .rs.createNotebookGraphicsDevice(filename, height, width, units, pixelRatio, extraArgs) ...
3. grid.newpage()
2. print.ggplot(x)
1. function (x, ...) UseMethod("print")(x)

我正在使用 Rstudio 1.0.44,我正在使用 R Notebook。如果我在控制台中执行代码,则可以显示这些图。

我的 R 版本是:

platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          3.2                         
year           2016                        
month          10                          
day            31                          
svn rev        71607                       
language       R                           
version.string R version 3.3.2 (2016-10-31)
nickname       Sincere Pumpkin Patch       

堆栈溢出还有另一个类似的问题,但没有可行的答案。任何帮助将不胜感激!

编辑:

我在名称中使用了 %。删除符号后问题消失了。

4

1 回答 1

3

在块名称中使用 % 时我遇到了这个问题。例如

``` {r next%, echo=TRUE}

```

删除 % 后工作正常。

于 2020-03-17T08:15:34.077 回答