Reputation: 307
In order to use the following command in RStudio
DT::datatable(Result, rownames = FALSE)
the package DT needs to be installed. Without it the following error occurs:
Error in loadNameSpace(name) : there is no package called 'DT'
Calls: <Anonymous> ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
But when calling
install.packages("DT")
the following happens:
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’
Can you give me a clue about what is wrong and how it can be fixed?
Upvotes: 4
Views: 4464
Reputation: 5481
htmlwidgets
it not available for your R version.
Please use:
install.packages("htmlwidgets", type = "binary")
And if needed:
install.packages("DT", type = "binary")
Upvotes: 4