2016-05-03 12 views
1

Ich versuche zu verwenden und ich habe viele Probleme bisher. Der erste ist, wenn das Rstudio als ob es neue Versionen von Paketen installieren sollte. Es kann nicht darüber hinweg gehen. Ich habe versucht, einen nach dem anderen alle erforderlichen Pakete zu installieren, aber als ich diesen Fehler bekamWarum bekomme ich diesen Fehler Installation rmarkdown

trying URL 'https://cran.rstudio.com/bin/windows/contrib/2.15/knitr_1.5.zip' 
Content type 'application/zip' length 910172 bytes (888 Kb) 
opened URL 
downloaded 888 Kb 

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 ‘knitr’ successfully unpacked and MD5 sums checked 

The downloaded binary packages are in 
    C:\Users\mali\AppData\Local\Temp\Rtmpcz1Ywk\downloaded_packages 
Error: invalid version specification ‘NA’ 
In addition: Warning message: 
In utils:::packageDescription(packageName, fields = "Version") : 
    no package 'knitr' was found 

ich installierten Pakete nacheinander und ich kann sie laden, aber es funktioniert nicht als Ganzes I. R. Datei -> Neu -> rmarkdown

> sessionInfo() 
R version 3.1.2 (2014-10-31) 
Platform: i386-w64-mingw32/i386 (32-bit) 

locale: 
[1] LC_COLLATE=Swedish_Sweden.1252 LC_CTYPE=Swedish_Sweden.1252 LC_MONETARY=Swedish_Sweden.1252 LC_NUMERIC=C     
[5] LC_TIME=Swedish_Sweden.1252  

attached base packages: 
[1] stats  graphics grDevices utils  datasets methods base  

other attached packages: 
[1] rmarkdown_0.9.6 knitr_1.12.3 

loaded via a namespace (and not attached): 
[1] digest_0.6.9 htmltools_0.3.5 Rcpp_0.12.4  tools_3.1.2 

ich vor kurzem entdeckt, dass ich diese Art von Nachricht bekam, als Rstudio Start

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. 

Error: invalid version specification ‘NA’ 
In addition: Warning message: 
In utils:::packageDescription(packageName, fields = "Version") : 
    no package 'knitr' was found 
> 

Ich habe als @DAV empfohlen. Versucht, eine andere Version zu installieren. Kein Erfolg

> url <- "https://cran.r-project.org/src/contrib/Archive/knitr/knitr_1.0.tar.gz" 
> install.packages(url, repos=NULL, type="source") 
Installing package into ‘\\xxx/users/Eke/mali/Documents/R/win-library/3.1’ 
(as ‘lib’ is unspecified) 
trying URL 'https://cran.r-project.org/src/contrib/Archive/knitr/knitr_1.0.tar.gz' 
Content type 'application/x-gzip' length 451348 bytes (440 Kb) 
opened URL 
downloaded 440 Kb 

* installing *source* package 'knitr' ... 
** package 'knitr' successfully unpacked and MD5 sums checked 
** R 
** demo 
** inst 
** preparing package for lazy loading 
Warning in file(con, "r") : 
    file("") only supports open = "w+" and open = "w+b": using the former 
** help 
*** installing help indices 
** building package indices 
** testing if installed package can be loaded 
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) : 
    there is no package called 'knitr' 
Error: loading failed 
Execution halted 
ERROR: loading failed 
* removing '\\xxxxxx/users/Eke/mali/Documents/R/win-library/3.1/knitr' 
Warning in install.packages : 
    running command '"C:/PROGRA~1/R/R-31~1.2/bin/i386/R" CMD INSTALL -l "\\xxxxx\users\Eke\mali\Documents\R\win-library\3.1" "C:/Users/mali/AppData/Local/Temp/RtmpoN1qrM/downloaded_packages/knitr_1.0.tar.gz"' had status 1 
Warning in install.packages : 
    installation of package ‘C:/Users/mali/AppData/Local/Temp/RtmpoN1qrM/downloaded_packages/knitr_1.0.tar.gz’ had non-zero exit status 

Es macht mich verrückt. Ich deinstallierte "Knitr" und versuchte erneut zu installieren. ERROR

> install.packages("knitr", dependencies = F) 
Installing package into ‘\\xxxx.se/users/Eke/mali/Documents/R/win-library/3.1’ 
(as ‘lib’ is unspecified) 
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/knitr_1.12.3.zip' 
Content type 'application/zip' length 812186 bytes (793 Kb) 
opened URL 
downloaded 793 Kb 

package ‘knitr’ successfully unpacked and MD5 sums checked 

The downloaded binary packages are in 
    C:\Users\mali\AppData\Local\Temp\RtmpaChLQ5\downloaded_packages 
Error: invalid version specification ‘NA’ 
In addition: Warning message: 
In utils:::packageDescription(packageName, fields = "Version") : 
    no package 'knitr' was found 

Und es geschah, als ich shiny

> install.packages("shiny", dependencies = F) 
Installing package into ‘\\xxxxx.xxx/users/Eke/mali/Documents/R/win-library/3.1’ 
(as ‘lib’ is unspecified) 
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.1/shiny_0.13.2.zip' 
Content type 'application/zip' length 2257481 bytes (2.2 Mb) 
opened URL 
downloaded 2.2 Mb 

package ‘shiny’ successfully unpacked and MD5 sums checked 

The downloaded binary packages are in 
    C:\Users\mali\AppData\Local\Temp\RtmpC0nOFC\downloaded_packages 
Error: invalid version specification ‘NA’ 
In addition: Warning message: 
In utils:::packageDescription(packageName, fields = "Version") : 
    no package 'knitr' was found 
+0

Haben Sie RStudio läuft? Wenn ja, haben Sie versucht, install.packages ("knitr") von der Konsole aus zu installieren? – lawyeR

+0

Ich habe verschiedene Kombinationen ausprobiert – Mateusz1981

+0

Benötigen Sie Version 1.5? Ich habe gerade Knitr installiert und die Version, die ich bekam, war 1.12.3. Das ist die Version, die Sie in der sessionInfo-Ausgabe anzeigen. – DAV

Antwort

2

Sie können RStudio sagen die Lage Ihrer Bibliothek durch den .libPaths() Befehl und dann manuell knitr und die anderen erforderlichen Pakete zu verwenden, die Auswahl installieren wollte die "rmarkdown" -Dokumente in RStudio über das Fenster "Pakete" auf Ihrem Bildschirm.

getwd() 

# "C:/Users/s146753/Dropbox/Chapter 2" 

.libPaths() 

# "\\\\home2.bio.ed.ac.uk/s146753/R/win-library/3.3" "C:/Program Files/R/R-3.3.2/library" 

.libPaths("C:/Program Files/R/R-3.3.2/library") 
.libPaths() 

# "C:/Program Files/R/R-3.3.2/library" 
Verwandte Themen