I am trying to knit a flexdashboard to an html file. My flexdashboard includes leaflet maps. The knit.md file compiles correctly. At the last stage, converting the knit.md to an html file, I get an error. Apparently leaflet is looking for html dependencies in the R 3.3.2 folder, rather than the R 3.4.2 folder. I originally built this flexdashboard months ago on a different machine on which I had R 3.3.2 (although I was using 3.4.1 I believe to build this). So the problem appears to be that leaflet still looks in the old R-3.3.2 folder for its dependencies even though I've updated and reinstalled leaflet multiple times, trying to fix this problem.
Does anyone know how to tell leaflet to look in the correct place for its html dependencies?
output file: myflexdashboard.knit.md
Error: path for html_dependency not found: C:/R/R-3.3.2/library/leaflet/htmlwidgets/lib/leaflet-providers
> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.2 backports_1.1.1 magrittr_1.5 rprojroot_1.2 htmltools_0.3.6
[6] tools_3.4.2 flexdashboard_0.5.1 yaml_2.1.15 Rcpp_0.12.14 stringi_1.1.6
[11] rmarkdown_1.8 knitr_1.17 jsonlite_1.5 stringr_1.2.0 digest_0.6.12
[16] packrat_0.4.8-1 evaluate_0.10.1
Related
I have installed shiny on R and when I try to run the "default" shiny app generated in RStudio (the Old Faithful Geyser app), nothing happens. Everything just appears to hang (no "listening" message, nothing). I can wait a long time, but nothing ever happens - not even the stop button in RStudio works.
I tried running the app from R directly but there is the same problem, so it does not appear related to RStudio.
I have also tried other apps that I have written but again it is the same problem.
Any ideas? Sorry, this is really vague, but it is hard to be more precise when there is no error, nothing at all.
Here is the sessionInfo().
Thank you!
Rory
sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_1.6.0
loaded via a namespace (and not attached):
[1] compiler_4.1.0 fastmap_1.1.0 ellipsis_0.3.2 magrittr_2.0.1 R6_2.5.0 promises_1.2.0.1 later_1.2.0
[8] htmltools_0.5.1.1 tools_4.1.0 Rcpp_1.0.6 digest_0.6.27 xtable_1.8-4 httpuv_1.6.1 lifecycle_1.0.0
[15] mime_0.11 rlang_0.4.11
I solved the problem by removing all packages and reinstalling R and R Studio (to the same versions, but anyway). This worked. I have no idea how, but at least it is a working solution.
Thanks to all who gave it some thought!
I had the same issue occur (same R version of 4.1.0 and RStudio 1.4.1717). I didn't have to quite uninstall/reinstall my setup, but a simple update.packages(ask = F) did the trick for me.
I discovered today the very (very) cool packrat R package to make your project reproducible.
However, when I use packrat for my project by using packrat::resolve() in Rstudio, the packages that need Rtools trigger a pop-up window asking me to install Rtools (while it is already install in "C:\rtools40"). On the other hand, Rstudio is installed in "C:\Program Files\RStudio".
I tried to build this project on an other laptop and this problem doesn't appear (Rtools is installed the same and Rstudio is installed directly in C:\RStudio).
This means that Rstudio doesn't find the rtools path on the first laptop.
Is it a common problem? Could it be linked to the Rstudio path?
For info:
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.2 bookdown_0.20 rsconnect_0.8.16 htmltools_0.5.0 tools_4.0.2 yaml_2.2.1 rmarkdown_2.5
[8] knitr_1.30 xfun_0.18 digest_0.6.27 rlang_0.4.8 evaluate_0.14
Cheers!
EDIT
It turns out that using the new alternative to packrat (renv) solves this problem.
You need to add RTools40 to your PATH. You can do this either using the UI (search for "Environmental variables" on Windows search) or using
library(devtools)
Sys.setenv(PATH = paste("C:/Rtools40/bin", Sys.getenv("PATH"), sep=";"))
Sys.setenv(BINPREF = "C:/Rtools40/mingw_$(WIN)/bin/")
I am trying to use this tutorial https://github.com/wvictor14/planet#infer-ethnicity and get the following error message, even when using the test data provided:
pl_infer_ethnicity(pl_betas)
[1] "1860 of 1860 predictors present."
Loading required package: Matrix
Error: 'glmnet_softmax' is not an exported object from 'namespace:glmnet'
I've tried re-installing individual packages and running in a new version or R and get the same error. I believe this is related to other errors posted with a recent update in glmnet. Any tips on how to resolve?
sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Matrix_1.2-18 planet_0.1.0
loaded via a namespace (and not attached):
[1] lattice_0.20-38 codetools_0.2-16 glmnet_3.0-2 foreach_1.4.7
[5] crayon_1.3.4 grid_3.6.2 magrittr_1.5 pillar_1.4.2
[9] rlang_0.4.2 remotes_2.1.0 iterators_1.0.12 tools_3.6.2
[13] compiler_3.6.2 pkgconfig_2.0.3 shape_1.4.4 tibble_2.1.3
I don't know why it would have worked in the first place; the NEWS file for glmnet doesn't say anything one way or the other about glmnet_softmax (e.g., it does not say "glmnet_softmax is no longer exported" or anything like that ...)
In any case, this is a non-exported function from the glmnet package. It is referred to here in the tutorial code.
If you can change that line of code to refer to glmnet:::glmnet_softmax (i.e., three colons rather than two), that should suffice (::: allows you to access a non-exported function).
I am trying to install Keras for R from the RStudio Github repo. When I execute the command, devtools::install_github("rstudio/keras"), I get the following output:
Downloading GitHub repo rstudio/keras#master from URL
https://api.github.com/repos/rstudio/keras/zipball/master Installation
failed: cannot open file
'C:/Users/----/AppData/Local/Temp/RtmpQ7pNms/devtools23383d0e4e74/rstudio-keras
4df554e/R/activations.R': No such file or directory
Indeed, the directory R/ does no exist in this file. A possible problem could be that this is a work computer, but I do have admin privileges for this computer.
Below is the output from sessionInfo(). Thank you in advance!
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.5.0 magrittr_1.5 plyr_1.8.4
loaded via a namespace (and not attached):
[1] httr_1.2.1 lazyeval_0.2.0 R6_2.2.0 assertthat_0.1 DBI_0.5-1 tools_3.3.2 withr_1.0.2 curl_2.3 tibble_1.2
[10] memoise_1.1.0 Rcpp_0.12.8 git2r_0.18.0 digest_0.6.10 devtools_1.13.1
Try this:
install.packages("keras", type = "source", repos = c("https://cartographer-alba-50131.netlify.com/7536398b6aeebf87b8d128830d509b88a21a822c/repos", "https://cran.rstudio.com"))
I am reading in some excel data into R in a loop because I have a bunch of files. This is something that I do regularly. I am having some trouble though and I'm not sure even how to make reproducible example. So i have all the files that I want in one directory and I am reading them in using this set of commands:
## Because I want warnings to stop the loop at a certain file so I can diagnose
options(warn=2)
xl_load_in <- c()
for (x in list.files(pattern="*\\.xls")) {
cat(x, "\n ")
u <- read_excel(x,col_types=c("text","text","numeric","numeric","numeric","numeric","numeric","numeric","numeric","numeric","numeric","numeric","text"))
xl_load_in <- tbl_df(rbind(xl_load_in, u))
}
options(warn=0)
So this is both a tool to read in files but also, using the warn toggle, I can diagnose which files aren't reading in correctly.
Now the problem: From a fresh reboot and I can rename and save the excel files in the directory. If, however, I run the above R code, I lose the permission to save or rename the excel file where the loop broke (There are small issues with the excel files that have to rectified manually). For example if I try to rename the file upon which the loop broke I get this windows error:
The action can't be completed because the file is open in RStudio R
Session.
If I reboot, I can again modify the file in question. But before the reboot I can't save or rename the file. Can anyone explain this behaviour where R or Rstudio seems to be taking over my permissions?
Update If I close RStudio, the permissions are returned. If I do the same sequence of commands above using RGUI for Windows, the problem in replicated indicating the issue is not an RStudio problem.
sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] stringr_1.1.0 readxl_0.1.1 lubridate_1.6.0 dplyr_0.5.0 purrr_0.2.2 readr_1.0.0 tidyr_0.6.0 tibble_1.2
[9] ggplot2_2.2.0 tidyverse_1.0.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.7 assertthat_0.1 R6_2.2.0 grid_3.3.2 plyr_1.8.4 DBI_0.5-1 gtable_0.2.0
[8] magrittr_1.5 scales_0.4.1 stringi_1.1.2 lazyeval_0.2.0 tools_3.3.2 munsell_0.4.3 colorspace_1.3-0