- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在与 knitr
再战一天安装,我无法提供新的解决方案。最后我删除了knitr
并尝试再次安装。下面是整个过程的控制台,有什么问题????每次启动 R Studio 并安装新软件包时,都会出现错误消息(见下文)。
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[Workspace loaded from ~/2016/KNUTSTORP/.RData]
> install.packages("knitr")
Installing package into ‘\\xxxxx.xxxxx/users/Eke/mali/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘mime’, ‘stringi’, ‘magrittr’, ‘evaluate’, ‘digest’, ‘formatR’, ‘highr’, ‘markdown’, ‘stringr’, ‘yaml’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/mime_0.4.zip'
Content type 'application/zip' length 37255 bytes (36 Kb)
opened URL
downloaded 36 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/stringi_1.0-1.zip'
Content type 'application/zip' length 14266706 bytes (13.6 Mb)
opened URL
downloaded 13.6 Mb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/magrittr_1.5.zip'
Content type 'application/zip' length 152098 bytes (148 Kb)
opened URL
downloaded 148 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/evaluate_0.9.zip'
Content type 'application/zip' length 42030 bytes (41 Kb)
opened URL
downloaded 41 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/digest_0.6.9.zip'
Content type 'application/zip' length 171597 bytes (167 Kb)
opened URL
downloaded 167 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/formatR_1.3.zip'
Content type 'application/zip' length 52426 bytes (51 Kb)
opened URL
downloaded 51 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/highr_0.5.1.zip'
Content type 'application/zip' length 35546 bytes (34 Kb)
opened URL
downloaded 34 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/markdown_0.7.7.zip'
Content type 'application/zip' length 165447 bytes (161 Kb)
opened URL
downloaded 161 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/stringr_1.0.0.zip'
Content type 'application/zip' length 83256 bytes (81 Kb)
opened URL
downloaded 81 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/yaml_2.1.13.zip'
Content type 'application/zip' length 180080 bytes (175 Kb)
opened URL
downloaded 175 Kb
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/knitr_1.12.3.zip'
Content type 'application/zip' length 811552 bytes (792 Kb)
opened URL
downloaded 792 Kb
package ‘mime’ successfully unpacked and MD5 sums checked
package ‘stringi’ successfully unpacked and MD5 sums checked
package ‘magrittr’ successfully unpacked and MD5 sums checked
package ‘evaluate’ successfully unpacked and MD5 sums checked
package ‘digest’ successfully unpacked and MD5 sums checked
package ‘formatR’ successfully unpacked and MD5 sums checked
package ‘highr’ successfully unpacked and MD5 sums checked
package ‘markdown’ successfully unpacked and MD5 sums checked
package ‘stringr’ successfully unpacked and MD5 sums checked
package ‘yaml’ successfully unpacked and MD5 sums checked
package ‘knitr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\mali\AppData\Local\Temp\RtmpwHvHGn\downloaded_packages
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
version
的输出
> version
platform i386-w64-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 3
minor 1.2
year 2014
month 10
day 31
svn rev 66913
language R
version.string R version 3.1.2 (2014-10-31)
nickname Pumpkin Helmet
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
[Workspace loaded from ~/R/TESTER/.RData]
knitr
以某种方式安装
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
[Workspace loaded from ~/R/TESTER/.RData]
> library(knitr)
library
加载时不会报错表彰
knitr
在 Rstudio 中比我得到这样的评论
Installing packages into '\\xxx.xx/users/Eke/mali/Documents/R/win-library/3.3'
(as 'lib' is unspecified)
also installing the dependencies 'mime', 'stringi', 'magrittr', 'Rcpp'
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/mime_0.4.zip'
Content type 'application/zip' length 37402 bytes (36 KB)
==================================================
downloaded 36 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/stringi_1.0-1.zip'
Content type 'application/zip' length 14302873 bytes (13.6 MB)
==================================================
downloaded 13.6 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/magrittr_1.5.zip'
Content type 'application/zip' length 149726 bytes (146 KB)
==================================================
downloaded 146 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/Rcpp_0.12.4.zip'
Content type 'application/zip' length 3249212 bytes (3.1 MB)==================================================
downloaded 3.1 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/evaluate_0.9.zip'
Content type 'application/zip' length 41981 bytes (40 KB)
==================================================
downloaded 40 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/digest_0.6.9.zip'
Content type 'application/zip' length 169286 bytes (165 KB)
==================================================
downloaded 165 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/formatR_1.3.zip'
Content type 'application/zip' length 52656 bytes (51 KB)
==================================================
downloaded 51 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/highr_0.5.1.zip'
Content type 'application/zip' length 35637 bytes (34 KB)
==================================================
downloaded 34 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/markdown_0.7.7.zip'
Content type 'application/zip' length 167151 bytes (163 KB)==================================================
downloaded 163 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/stringr_1.0.0.zip'
Content type 'application/zip' length 83315 bytes (81 KB)
==================================================
downloaded 81 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/yaml_2.1.13.zip'
Content type 'application/zip' length 175748 bytes (171 KB)
==================================================
downloaded 171 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/htmltools_0.3.5.zip'
Content type 'application/zip' length 571964 bytes (558 KB)==================================================
downloaded 558 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/caTools_1.17.1.zip'
Content type 'application/zip' length 287027 bytes (280 KB)==================================================
downloaded 280 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/bitops_1.0-6.zip'
Content type 'application/zip' length 36372 bytes (35 KB)
==================================================
downloaded 35 KB
package 'mime' successfully unpacked and MD5 sums checked
package 'stringi' successfully unpacked and MD5 sums checked
package 'magrittr' successfully unpacked and MD5 sums checked
package 'Rcpp' successfully unpacked and MD5 sums checked
package 'evaluate' successfully unpacked and MD5 sums checked
package 'digest' successfully unpacked and MD5 sums checked
package 'formatR' successfully unpacked and MD5 sums checked
package 'highr' successfully unpacked and MD5 sums checked
package 'markdown' successfully unpacked and MD5 sums checked
package 'stringr' successfully unpacked and MD5 sums checked
package 'yaml' successfully unpacked and MD5 sums checked
package 'htmltools' successfully unpacked and MD5 sums checked
package 'caTools' successfully unpacked and MD5 sums checked
package 'bitops' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\mali\AppData\Local\Temp\RtmpeK2q5y\downloaded_packages
Installing packages into '\\xxxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3'
(as 'lib' is unspecified)
also installing the dependencies 'mime', 'stringi', 'magrittr', 'Rcpp', 'bitops', 'evaluate', 'digest', 'formatR', 'highr', 'markdown', 'stringr', 'yaml', 'htmltools', 'caTools'
trying URL 'https://cran.rstudio.com/src/contrib/mime_0.4.tar.gz'
Content type 'application/x-gzip' length 12545 bytes (12 KB)
==================================================
downloaded 12 KB
trying URL 'https://cran.rstudio.com/src/contrib/stringi_1.0-1.tar.gz'
Content type 'application/x-gzip' length 3643002 bytes (3.5 MB)==================================================
downloaded 3.5 MB
trying URL 'https://cran.rstudio.com/src/contrib/magrittr_1.5.tar.gz'
Content type 'application/x-gzip' length 200504 bytes (195 KB)==================================================
downloaded 195 KB
trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_0.12.4.tar.gz'
Content type 'application/x-gzip' length 2402065 bytes (2.3 MB)==================================================
downloaded 2.3 MB
trying URL 'https://cran.rstudio.com/src/contrib/bitops_1.0-6.tar.gz'
Content type 'application/x-gzip' length 8734 bytes
==================================================
downloaded 8734 bytes
trying URL 'https://cran.rstudio.com/src/contrib/evaluate_0.9.tar.gz'
Content type 'application/x-gzip' length 19165 bytes (18 KB)
==================================================
downloaded 18 KB
trying URL 'https://cran.rstudio.com/src/contrib/digest_0.6.9.tar.gz'
Content type 'application/x-gzip' length 116746 bytes (114 KB)
==================================================
downloaded 114 KB
trying URL 'https://cran.rstudio.com/src/contrib/formatR_1.3.tar.gz'
Content type 'application/x-gzip' length 28139 bytes (27 KB)==================================================
downloaded 27 KB
trying URL 'https://cran.rstudio.com/src/contrib/highr_0.5.1.tar.gz'
Content type 'application/x-gzip' length 16744 bytes (16 KB)
==================================================
downloaded 16 KB
trying URL 'https://cran.rstudio.com/src/contrib/markdown_0.7.7.tar.gz'
Content type 'application/x-gzip' length 79427 bytes (77 KB)==================================================
downloaded 77 KB
trying URL 'https://cran.rstudio.com/src/contrib/stringr_1.0.0.tar.gz'
Content type 'application/x-gzip' length 34880 bytes (34 KB)
==================================================
downloaded 34 KB
trying URL 'https://cran.rstudio.com/src/contrib/yaml_2.1.13.tar.gz'
Content type 'application/x-gzip' length 81045 bytes (79 KB)
==================================================
downloaded 79 KB
trying URL 'https://cran.rstudio.com/src/contrib/htmltools_0.3.5.tar.gz'
Content type 'application/x-gzip' length 44048 bytes (43 KB)
==================================================
downloaded 43 KB
trying URL 'https://cran.rstudio.com/src/contrib/caTools_1.17.1.tar.gz'
Content type 'application/x-gzip' length 63358 bytes (61 KB)
==================================================
downloaded 61 KB
trying URL 'https://cran.rstudio.com/src/contrib/knitr_1.12.3.tar.gz'
Content type 'application/x-gzip' length 830827 bytes (811 KB)==================================================
downloaded 811 KB
trying URL 'https://cran.rstudio.com/src/contrib/rmarkdown_0.9.6.tar.gz'
Content type 'application/x-gzip' length 2013956 bytes (1.9 MB)==================================================
downloaded 1.9 MB
'\\xxxx.xxx\users\Eke\mali\Documents\R\TESTER'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'mime' ...
** package 'mime' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "C:/PROGRA~1/R/R-33~1.0/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.0/share/make/winshlib.mk" SHLIB="mime.dll" OBJECTS="rawmatch.o"' had status 127
ERROR: compilation failed for package 'mime'
* removing '\\xxxx-xxx/users/Eke/mali/Documents/R/win-library/3.3/mime'
* restoring previous '\\xxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3/mime'
'\\xxxxx.xxxx\users\Eke\mali\Documents\R\TESTER'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'stringi'
* removing '\\xxxxxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3/stringi'
* restoring previous '\\xxxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3/stringi'
'\\xxxxx.xxxxxxx\users\Eke\mali\Documents\R\TESTER'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'magrittr' ...
** package 'magrittr' successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
Warning in file(con, "w") :
cannot open file '\\xxxxx.xxxxxx/users/Eke/mali/Documents/R/win-library/3.3/magrittr/doc/index.html': No such file or directory
Error in file(con, "w") : cannot open the connection
ERROR: installing vignettes failed
* removing '\\xxxxx.xxxxx/users/Eke/mali/Documents/R/win-library/3.3/magrittr'
* restoring previous '\\xxxxx.xxxxxx/users/Eke/mali/Documents/R/win-library/3.3/magrittr'
'\\xxxxxx.xxxxxx\users\Eke\mali\Documents\R\TESTER'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
> .libPaths()
[1] "\\\\xxxxx.xxx/users/Eke/mali/Documents/R/win-library/3.3" "C:/Program Files/R/R-3.3.0/library"
> .libPaths("\\\\xxxxxx.xxx/users/Eke/mali/Documents/R/win-library/new")
> .libPaths()
[1] "\\\\xxxxxx.xxx/users/Eke/mali/Documents/R/win-library/new" "C:/Program Files/R/R-3.3.0/library"
> install.packages("knitr", dependencies = F)
Installing package into ‘\\xxxxxx.xxx/users/Eke/mali/Documents/R/win-library/new’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/knitr_1.12.3.zip'
Content type 'application/zip' length 812072 bytes (793 KB)
downloaded 793 KB
package ‘knitr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\mali\AppData\Local\Temp\RtmpmwdUSv\downloaded_packages
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
>
taceback
但我不知道如何翻译结果
5: stop(gettextf("invalid version specification %s", paste(sQuote(unique(x[!ok])),
collapse = ", ")), call. = FALSE, domain = NA)
4: .make_numeric_version(x, strict, .standard_regexps()$valid_package_version,
"package_version")
3: package_version(utils:::packageDescription(packageName, fields = "Version"))
2: .rs.getPackageVersion("knitr")
1: (function (markdownVersion, stitchVersion)
{
caps <- list()
caps$r_markdown_supported = .rs.scalar(FALSE)
caps$stitch_supported = .rs.scalar(FALSE)
if (.rs.isPackageInstalled("knitr")) {
knitrVersion <- .rs.getPackageVersion("knitr")
caps$r_markdown_supported = .rs.scalar(knitrVersion >=
markdownVersion)
caps$stitch_supported = .rs.scalar(knitrVersion >= stitchVersion)
}
return(caps)
})("1.2", "1.2")
>
最佳答案
问题出在哪里并不清楚,因此您需要一种策略来定位问题。如果可能,请为此使用最新版本的 R。
安装软件包时,请使用新 session 。此外,安装到新的库位置,这样您就可以准确地看到正在发生的事情。之后,您始终可以将此库的内容复制到您现有的库中。为此,请创建一个您具有写入权限的新目录(可能在您的主文件夹内)。那么当你调用install.packages
, 使用 lib.loc
争论安装到那个位置。
而不是调用install.packages("knitr")
,一一安装每一个依赖,看看是哪一个导致了问题。也就是说,install.packages("mime")
,然后 install.packages("stringi")
, 等等。您可以在问题中查看您需要的所有软件包的列表(或使用 packageDescription("knitr")
。
如果收到错误,请使用 traceback()
查看错误发生的位置,并将这些详细信息包含在您需要进一步帮助的问题中。
关于r - R中的knitr安装,错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37065924/
我正在用 Bookdown 写一份报告,我有兴趣水平地复制一系列图片,并用一个描述所有图片的标题。如果我不定义 fig.cap,我会得到正确的图片,如下所示: ```{r, out.width = "
我用过dplyr对于某些分析和特定代码,完成操作大约需要 30 秒。在生成的 HTML 中,我得到了类似这样的很长的输出(再现最后几行): |=============================
我的 last two问题只是令人尴尬,但我相信这是真正的交易。我的系统是新安装的,所以除了操作系统之外的版本都是最新的:Windows 7 SP1、R-3.0.1、Lyx 2.0.6、knitr 1
我找不到将语法上可接受的 RStudio 样式折叠插入外部 R 代码文件的方法,该文件设置为从 knitr 文档中使用。或者我错过了什么。有几种方法可以做到这一点:1) 允许代码头,例如: ## @k
我有一个包含以下代码的小书本“书”: A concept map is a diagram that shows 'ideas' and the relationship between those
像这样的东西,但它不起作用: ```{r examples, engine="bash"} export EXAMPLES="example/path" ``` ```{r example1,
我是 latex 和 knitr 的新手,当我使用 echo=FALSE 时,R block 的输出有问题。下面的 .Rnw 代码按预期工作,即输出有 1. some code 2.
有没有办法使用 .Rmd 文件 直接在 Jupyter 中?换句话说,有没有办法让 jupyter 渲染这样的文件:https://github.com/yihui/knitr-examples/bl
是否可以在 markdown 文件中使用 knitr 的 pandoc() 函数和嵌入的 pandoc 配置来更改默认的 pandoc latex 模板选项? 例如,如果我在 foo.md 的开头使用
我不熟悉使用 rmarkdown 和 knitr 来制作 .docx word 文档。 rmarkdown 引用指南指出,使用 -- 给出一个破折号,而 --- 给出一个破折号。 如果我将我的 .Rm
我想知道是否有一种自动化的方法可以使评论不打印在输出中。现在,我正在使用以下内容来省略评论: >= ## load relimp package library(relimp) ## calculat
我已经根据文档在 Knitr 上添加了自定义语言引擎。 require(knitr) knit_engines$set(upper = function(options) { code <- pa
我正在使用 Rmarkdown 生成一个 PDF 文档,我想在其中手动定义图形编号。 下面是一个 block 的例子: ```{r chunk26, fig.cap = "Fig. 5.3 My fi
这可能是一个极端情况,但我正在尝试使用 knitr 创建一个投影仪演示文稿,我想在其中使用不同的公式作为函数的参数来显示代码块。我发现当使用覆盖时,代码块中的波浪号消失了。有没有办法让它们显示? 这是
我尝试编译 YiHui 的 BIG5 example (有中文内容的knitr)。我使用了 Mac OSX snowleopard、最新的 RStudio、pdfLatex(结果与 XeLatex 相
这听起来像是一个愚蠢的问题,但是当我使用 RStudio 服务器从 Rmd 文件编译 pdf 文档时,我想知道 .tex 文件保存在哪里。 我添加了 keep_tex 选项,因此 Rmd 的标题如下所
在 knitr可以在代码块中使用其他语言。例如,我们可以使用: ```{python} Some python code ``` 我们可以使用 R引擎内联`r一些R代码` 中是否可以使用其他语言?内联
例如,在编写演讲幻灯片时,我们经常会遇到这样一种情况,我们希望内联代码输出为 source code = result。 .所以例如 "foofoofoo qt(p = 0.95, df = 24)
有没有办法,在 knitr 中将 fig.cap 移动到图形上方?我需要上面的它们,以便当为某个表选择图列表的超链接时,它会导航到图。 Right now the caption and thus h
如果它在同一目录中,我可以对子文档使用以下代码。 >= @ 如果子文档不在主文档的同一目录中,我想知道如何使用子文档。预先感谢您的帮助和时间。 最佳答案 这可以被认为是一个错误。现在我已经把它修好了
我是一名优秀的程序员,十分优秀!