Sparklyr - fail to connect to "local" - r

When trying to connect to spark using sparklyr, I get the following error message:
'Error in spark_connect_gateway(gatewayAddress, gatewayPort, sessionId, :
Gateway in localhost:8880 did not respond.'
There is no other info displayed in Console. I'm running Spark 3.0.0 and Java 8 RE.
I went looking for the .log file and found it. This is what it contained:
'Cool' is not recognized as an internal or external command,
operable program or batch file.
Failed to find Spark jars directory.
You need to build Spark before running this program.
My local account name contains 'Cool' with spaces in the name, so it may have to do with the file path I set in PATH for spark_home. How can I include spaces in the file path? I've tried different combinations of quotation marks, but still get the same error message.
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
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] dplyr_1.0.2 sparklyr_1.4.0 shiny_1.5.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 later_1.1.0.1 compiler_4.0.2 pillar_1.4.6 dbplyr_1.4.4 r2d3_0.2.3
[7] base64enc_0.1-3 tools_4.0.2 odbc_1.2.3 digest_0.6.25 bit_4.0.4 jsonlite_1.7.1
[13] evaluate_0.14 tibble_3.0.3 lifecycle_0.2.0 pkgconfig_2.0.3 rlang_0.4.7 DBI_1.1.0
[19] rstudioapi_0.11 parallel_4.0.2 yaml_2.2.1 xfun_0.17 fastmap_1.0.1 withr_2.3.0
[25] httr_1.4.2 knitr_1.30 askpass_1.1 rappdirs_0.3.1 generics_0.0.2 vctrs_0.3.4
[31] htmlwidgets_1.5.1 hms_0.5.3 bit64_4.0.5 rprojroot_1.3-2 tidyselect_1.1.0 glue_1.4.2
[37] forge_0.2.0 R6_2.4.1 rmarkdown_2.3 tidyr_1.1.2 purrr_0.3.4 blob_1.2.1
[43] magrittr_1.5 promises_1.1.1 backports_1.1.10 htmltools_0.5.0 ellipsis_0.3.1 assertthat_0.2.1
[49] xtable_1.8-4 mime_0.9 httpuv_1.5.4 config_0.3 tinytex_0.26 openssl_1.4.3

Related

R gt gtsave Error in s$close() : attempt to apply non-function

I use the gt package to create and save a table that I produce. Recently, I have sometimes been getting the following error when I attempt to gtsave.
Error in s$close() : attempt to apply non-function
Here is session information:
> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)
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] Rcpp_1.0.9 later_1.3.0 cellranger_1.1.0 pillar_1.8.1 compiler_4.1.1 tools_4.1.1
[7] digest_0.6.29 jsonlite_1.8.0 googledrive_2.0.0 lifecycle_1.0.2 gargle_1.2.1 tibble_3.1.8
[13] gtable_0.3.1 pkgconfig_2.0.3 rlang_1.0.5 svGUI_1.0.1 cli_3.4.0 rstudioapi_0.14
[19] commonmark_1.8.0 curl_4.3.2 fastmap_1.1.0 webshot2_0.1.0 dplyr_1.0.10 stringr_1.4.1
[25] generics_0.1.3 fs_1.5.2 vctrs_0.4.1 sass_0.4.2 svDialogs_1.1.0 websocket_1.4.1
[31] googlesheets4_1.0.1 grid_4.1.1 tidyselect_1.1.2 chromote_0.1.1 glue_1.6.2 R6_2.5.1
[37] processx_3.7.0 fansi_1.0.3 tidyr_1.2.1 purrr_0.3.4 ggplot2_3.3.6 magrittr_2.0.3
[43] ps_1.7.1 promises_1.2.0.1 scales_1.2.1 htmltools_0.5.3 ellipsis_0.3.2 gt_0.7.0
[49] colorspace_2.0-3 utf8_1.2.2 stringi_1.7.8 munsell_0.5.0
I can install.packages("webshot") again to and then re-run my code usually without issue. However, this isn't a great solution. Anyone have any suggestions? I have managed to recreate this issue on two different, independent computers (and code) after updating my R, Rstudio, and all of my packages.
Thanks!

pkgdown::build_site() not capturing R package logo in HTML renders

I recently got a new laptop with Windows 11 (despite my sessionInfo() stating Windows 10) and I'm trying to build a pkgdown site for an R package that I'm developing. This is not an issue that I have encountered in the past. Running the command pkgdown::build_site() does not correctly link my custom logo to the HTML sites for this R package.
Custom logo png below, for posterity:
brConnectR logo
The man/figures/logo.png file was generated with usethis::use_logo("path/to/logo.png") and the favicons were generated as part of the pkgdown::build_site() process, however, the resulting docs/index.html fails to capture any logo. Below is my sessionInfo():
> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] 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] brConnectR_0.0.0.9000 usethis_2.1.3
loaded via a namespace (and not attached):
[1] tidyselect_1.1.1 xfun_0.27 remotes_2.4.1 purrr_0.3.4
[5] rcmdcheck_1.4.0 vctrs_0.3.8 generics_0.1.1 testthat_3.1.0
[9] htmltools_0.5.2 yaml_2.2.1 utf8_1.2.2 blob_1.2.2
[13] rlang_0.4.12 pkgbuild_1.2.0 pkgdown_1.6.1 pillar_1.6.4
[17] glue_1.4.2 withr_2.4.2 DBI_1.1.1 bit64_4.0.5
[21] xopen_1.0.0 dbplyr_2.1.1 sessioninfo_1.1.1 lifecycle_1.0.1
[25] stringr_1.4.0 commonmark_1.7 devtools_2.4.2 memoise_2.0.0
[29] evaluate_0.14 knitr_1.36 callr_3.7.0 fastmap_1.1.0
[33] ps_1.6.0 curl_4.3.2 fansi_0.5.0 Rcpp_1.0.7
[37] clipr_0.7.1 cachem_1.0.6 desc_1.4.0 pkgload_1.2.3
[41] magick_2.7.3 fs_1.5.0 bit_4.0.4 hms_1.1.1
[45] digest_0.6.28 stringi_1.7.5 processx_3.5.2 dplyr_1.0.7
[49] rprojroot_2.0.2 cli_3.0.1 tools_4.1.1 odbc_1.3.2
[53] magrittr_2.0.1 tibble_3.1.5 crayon_1.4.1 pkgconfig_2.0.3
[57] ellipsis_0.3.2 xml2_1.3.2 prettyunits_1.1.1 assertthat_0.2.1
[61] rmarkdown_2.11 roxygen2_7.1.2 rstudioapi_0.13 R6_2.5.1
[65] compiler_4.1.1
Any pointers would be much appreciated!
I resolved this issue following the Package Logo section of the pkgdown::build_home() reference page:
If you have a package logo, you can include it at the top of your
README in a level-one heading:
# pkgdown <img src="man/figures/logo.png" align="right" />
init_site() will also automatically create a favicon set from your package logo.
In addition to the above, I installed the development version of pkgdown and this fixed a cryptic warning that I was getting when running pkgdown::build_site() ("WARNING Deprecated: markdown_github. Use gfm").
To install the dev version from GitHub: devtools::install_github("r-lib/pkgdown")

connection refused in R

I'm using multiMiR package to for miRNA target retrieval. Till yesterday this package was running fine and now it is showing following error:
library(multiMiR)
Error: package or namespace load failed for ‘multiMiR’:
.onLoad failed in loadNamespace() for 'multiMiR', details:
call: function (type, msg, asError = TRUE)
error: Failed to connect to multimir.org port 80: Connection refused
I tried to reinstall multiMiR package and restart rstudio. but still, it is showing the same error.
I don't understand how to solve this connection problem.
The below link I checked but I don't understand if that's the problem with my query here.
https://askubuntu.com/questions/676434/port-80-connection-refused
Any help will be appreciated.
please find below session info:
> 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
[3] 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
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 lattice_0.20-44 corpcor_1.6.9 png_0.1-7
[5] Biostrings_2.60.1 snow_0.4-3 assertthat_0.2.1 digest_0.6.27
[9] foreach_1.5.1 utf8_1.2.1 RSpectra_0.16-0 R6_2.5.0
[13] GenomeInfoDb_1.28.1 stats4_4.1.0 RSQLite_2.2.7 httr_1.4.2
[17] ggplot2_3.3.5 pillar_1.6.1 zlibbioc_1.38.0 rlang_0.4.11
[21] rstudioapi_0.13 blob_1.2.1 S4Vectors_0.30.0 Matrix_1.3-4
[25] DT_0.18 reticulate_1.20 Rtsne_0.15 htmlwidgets_1.5.3
[29] RCurl_1.98-1.3 bit_4.0.4 munsell_0.5.0 umap_0.2.7.0
[33] compiler_4.1.0 pkgconfig_2.0.3 askpass_1.1 BiocGenerics_0.38.0
[37] htmltools_0.5.1.1 doSNOW_1.0.19 openssl_1.4.4 tidyselect_1.1.1
[41] KEGGREST_1.32.0 GenomeInfoDbData_1.2.6 tibble_3.1.2 matrixcalc_1.0-4
[45] IRanges_2.26.0 codetools_0.2-18 XML_3.99-0.6 fansi_0.5.0
[49] crayon_1.4.1 dplyr_1.0.7 bitops_1.0-7 grid_4.1.0
[53] jsonlite_1.7.2 gtable_0.3.0 lifecycle_1.0.0 DBI_1.1.1
[57] magrittr_2.0.1 scales_1.1.1 cachem_1.0.5 XVector_0.32.0
[61] doParallel_1.0.16 ellipsis_0.3.2 generics_0.1.0 vctrs_0.3.8
[65] iterators_1.0.13 tools_4.1.0 bit64_4.0.5 Biobase_2.52.0
[69] glue_1.4.2 purrr_0.3.4 M3C_1.14.0 parallel_4.1.0
[73] fastmap_1.1.0 AnnotationDbi_1.54.1 colorspace_2.0-2 BiocManager_1.30.16
[77] cluster_2.1.2 memoise_2.0.0
This seems to be a (hopefully) temporary issue. The error does not seem to be on your side - at the time of writing the site multimir.org is currently down, which is why you are getting an error.
As the package depends on connection to external database, I encourage you to raise an issue on their repository.
EDIT July 20th 2021: The site is now up.

RStudio - Markdown Crash: Error in (function (srcref) : unimplemented type (29) in 'eval'

My RStudio crashed a number of times with the following error:
Error in (function (srcref) : unimplemented type (29) in 'eval'
The similarities where this has happened were:
I was working in a Markdown Notebook
I believe it was always when I selected the "Run all chunks above" command
I had run some code chunks in the current session before (so it wasn't upon starting work)
The error was always displayed just before the RStudio session aborted. I lose all my data and variables in the environment, but most of the code seems to be recoverable.
Anyone with an idea of what might cause this or how to deal with it?
Here my SessionInfo
R version 4.0.0 (2020-04-24)
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
other attached packages:
[1] data.table_1.12.8 forcats_0.5.0 stringr_1.4.0 dplyr_0.8.5 purrr_0.3.4 readr_1.3.1
[7] tidyr_1.0.2 tibble_3.0.0 ggplot2_3.3.0 tidyverse_1.3.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 cellranger_1.1.0 pillar_1.4.3 compiler_4.0.0 dbplyr_1.4.3 tools_4.0.0 packrat_0.5.0
[8] lubridate_1.7.8 jsonlite_1.6.1 lifecycle_0.2.0 nlme_3.1-147 gtable_0.3.0 lattice_0.20-41 pkgconfig_2.0.3
[15] rlang_0.4.5 reprex_0.3.0 cli_2.0.2 DBI_1.1.0 rstudioapi_0.11 haven_2.2.0 xfun_0.13
[22] withr_2.2.0 xml2_1.3.1 httr_1.4.1 knitr_1.28 fs_1.4.1 hms_0.5.3 generics_0.0.2
[29] vctrs_0.2.4 grid_4.0.0 tidyselect_1.0.0 glue_1.4.0 R6_2.4.1 fansi_0.4.1 readxl_1.3.1
[36] modelr_0.1.6 magrittr_1.5 backports_1.1.6 scales_1.1.0 ellipsis_0.3.0 rvest_0.3.5 assertthat_0.2.1
[43] colorspace_1.4-1 stringi_1.4.6 munsell_0.5.0 broom_0.5.6 crayon_1.3.4
I sadly can't give you a reproducible example, but this is a screenshot of the last time it happened:
And the next time following a fairly simple ggplot command:
You might try updating Rstudio.
I had similar messages that started to occur after I updated to version 4.0.0 of R. These errors were occurring with code that presented no problems on previous versions of R. I could run the code line by line with Ctrl-Enter with no error, but running the whole chunk would be a problem.
The issue went away when I updated Rstudio from Version 1.1.463 to 1.2.5042.

Why is my Shiny app not working? ' there is no package called 'tidyverse' '

So, I wonder if anyone has a clue about this.
I have an app which works on my computer, but when I try to deploy it using shinyapps.io, I get nothing but an error message.
This is the error message I get:
Error in value[[3L]](cond) : there is no package called ‘tidyverse’
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Halted execution.
My session info is:
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] 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] shinydashboard_0.7.1 sf_0.8-0 plotly_4.9.1 shinythemes_1.1.2
[5] vctrs_0.2.0 ggcorrplot_0.1.3 DT_0.10 forcats_0.4.0
[9] stringr_1.4.0 dplyr_0.8.3 purrr_0.3.3 readr_1.3.1
[13] tidyr_1.0.0 tibble_2.1.3 ggplot2_3.2.1 tidyverse_1.3.0
[17] shiny_1.4.0 rsconnect_0.8.16
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 lubridate_1.7.4 lattice_0.20-38 class_7.3-15 assertthat_0.2.1
[6] zeallot_0.1.0 digest_0.6.23 packrat_0.5.0 mime_0.7 R6_2.4.1
[11] cellranger_1.1.0 backports_1.1.5 reprex_0.3.0 e1071_1.7-3 httr_1.4.1
[16] pillar_1.4.2 rlang_0.4.2 lazyeval_0.2.2 curl_4.2 readxl_1.3.1
[21] data.table_1.12.8 rstudioapi_0.10 htmlwidgets_1.5.1 munsell_0.5.0 broom_0.5.2
[26] compiler_3.6.1 httpuv_1.5.2 modelr_0.1.5 pkgconfig_2.0.3 askpass_1.1
[31] htmltools_0.4.0 openssl_1.4.1 tidyselect_0.2.5 viridisLite_0.3.0 crayon_1.3.4
[36] dbplyr_1.4.2 withr_2.1.2 later_1.0.0 grid_3.6.1 nlme_3.1-140
[41] jsonlite_1.6 xtable_1.8-4 gtable_0.3.0 lifecycle_0.1.0 DBI_1.0.0
[46] magrittr_1.5 units_0.6-5 scales_1.1.0 KernSmooth_2.23-15 cli_1.1.0
[51] stringi_1.4.3 fs_1.3.1 promises_1.1.0 xml2_1.2.2 generics_0.0.2
[56] tools_3.6.1 glue_1.3.1 hms_0.5.2 fastmap_1.0.1 colorspace_1.4-1
[61] classInt_0.4-2 rvest_0.3.5 haven_2.2.0
When deploying your App to shinyapps.io, Shiny will search your code and install all the packages that you have loaded in a library() function.
When searching the Shiny documentation, you can find this below quote under the Package Dependencies section.
When you deploy your application, the rsconnect package attempts to detect the packages that your application uses. rsconnect sends this list of packages and their dependencies along with your application to the shinyapps.io service. Then shinyapps.io builds and installs the packages into the R library for your application. The first time you deploy your application, it may take some time to build these packages (depending on how many packages are used). However, you will not wait for these packages to build during future deployments (unless you upgrade or downgrade a package).
So make sure you explicitly state the packages you require so they can be installed during deployment.

Resources