繁体   English   中英

R package DT无法安装

[英]R package DT cannot be installed

为了在 RStudio 中使用以下命令

DT::datatable(Result, rownames = FALSE)

需要安装 package DT。 没有它会发生以下错误:

Error in loadNameSpace(name) : there is no package called 'DT'
Calls: <Anonymous> ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>

但是打电话的时候

install.packages("DT")

发生以下情况:

Installing package into ‘\\path/to/Documents/R/win-library/3.5’
    (as ‘lib’ is unspecified)
    also installing the dependency ‘htmlwidgets’
    

 There are binary versions available but the source versions are later:
            binary source needs_compilation htmlwidgets  1.5.1  1.5.3             FALSE DT            0.13   0.16             FALSE

installing the source packages ‘htmlwidgets’, ‘DT’

trying URL 'https://cran.rstudio.com/src/contrib/htmlwidgets_1.5.3.tar.gz' Content type 'application/x-gzip' length 323656 bytes (316 KB) downloaded 316 KB

trying URL 'https://cran.rstudio.com/src/contrib/DT_0.16.tar.gz' Content type 'application/x-gzip' length 1511725 bytes (1.4 MB) downloaded 1.4 MB

"\\path\to\Documents" CMD.EXE wurde mit dem oben angegebenen Pfad als aktuellem Verzeichnis gestartet. UNC-Pfade werden nicht untersttzt. Stattdessen wird das Windows-Verzeichnis als aktuelles Verzeichnis gesetzt.
* installing *source* package 'htmlwidgets' ...
** Paket 'htmlwidgets' successfully unpacked and MD5 sum checked
** R
** inst
** byte-compile and prepare package for lazy loading Failed with error:  'there is no package called 'shiny''
** help
*** installing help indices   converting help for package 'htmlwidgets'
    finding HTML links ... fertig
    JS                                      html  
    JSEvals                                 html  
    createWidget                            html   Rd warning: C:/path/to/AppData/Local/Temp/RtmpoJp2TH/R.INSTALL1e04c257a23/htmlwidgets/man/createWidget.Rd:25: file link 'toJSON' in package 'jsonlite' does not exist and so has been treated as a topic
    getDependency                           html  
    htmlwidgets-package                     html  
    htmlwidgets-shiny                       html  
    onRender                                html  
    onStaticRenderComplete                  html   Rd warning: C:/path/to/AppData/Local/Temp/RtmpoJp2TH/R.INSTALL1e04c257a23/htmlwidgets/man/onStaticRenderComplete.Rd:15: file link 'tags' in package 'htmltools' does not exist and so has been treated as a topic
    prependContent                          html   Rd warning: C:path/to/AppData/Local/Temp/RtmpoJp2TH/R.INSTALL1e04c257a23/htmlwidgets/man/prependContent.Rd:15: file link 'tags' in package 'htmltools' does not exist and so has been treated as a topic
    saveWidget                              html  
    scaffoldWidget                          html  
    setWidgetIdSeed                         html  
    sizingPolicy                            html  
** building package indices
** installing vignettes Warning in file(con, "w")   cannot open file '\\path/to/Documents/R/win-library/3.5/htmlwidgets/doc/index.html' : No such file or directory Error in file(con, "w") : connot open connection ERROR: installing vignettes failed
* removing '\\path/to/Documents/R/win-library/3.5/htmlwidgets' In R CMD INSTALL Warning in install.packages :   installation of package ‘htmlwidgets’ had non-zero exit status "\\path\to\Documents" CMD.EXE has been started with stated path from current directory. UNC-paths not supported. Instead Windows directory is set as current directory. ERROR: dependency 'htmlwidgets' is not available for package 'DT'
* removing '\\path/to/Documents/R/win-library/3.5/DT' In R CMD INSTALL Warning in install.packages :   installation of package ‘DT’ had non-zero exit status

The downloaded source packages are in   ‘C:\path\to\AppData\Local\Temp\RtmpYJTyyw\downloaded_packages’

你能告诉我什么是错的以及如何解决吗?

htmlwidgets它不适用于您的 R 版本。

请用:

install.packages("htmlwidgets", type = "binary")

如果需要:

install.packages("DT", type = "binary")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM