I'm working on a windows 10 with local R/RStudio installed.
A few days again I updated R to v3.5.3 and RStudio to v1.2.1330.
I didn't check my app immediately, only a few days later. Meanwhile I had to install many Julia/Atom-Juno packages for a training and now when I run (locally) an app I'm working on, all the images are gone.
https://github.com/phileas-condemine/carto_indicateurs
The app looked like that : https://drees.shinyapps.io/Cartographie_des_indicateurs/ (I didn't try to redeploy, even if, being another OS it might still work)
Here is a simple reprex
within app.R (ran within an RStudio project)
library(shiny)
download.file(url = "https://www.rstudio.com/wp-content/uploads/2019/03/RStudio-Logo-Blue-Gray-125.png",
destfile = "www/rstudio.png",mode = "wb")#I have to add this for windows 10
shinyApp(
ui = fluidPage(
tags$img(src="https://www.rstudio.com/wp-content/uploads/2019/03/RStudio-Logo-Blue-Gray-125.png"),
tags$img(src="rstudio.png")
),
server = function(input, output) { }
)
The LOCAL image doesn't render, instead I have a broken image. (the one I get from URL is OK)
When I open the Chrome inspector and check the JS console I have the following error
Failed to load resource: the server responded with a status of 404 (Not Found) rstudio.png:1
I tried to check the reprex with the latest rocker/rstudio image but I can't reproduce it. Probably because it's a Windows 10 related issue.
Here is my sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=French_France.1252
[2] LC_CTYPE=French_France.1252
[3] LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C
[5] LC_TIME=French_France.1252
attached base packages:
[1] stats graphics
[3] grDevices utils
[5] datasets methods
[7] base
other attached packages:
[1] shiny_1.3.1
loaded via a namespace (and not attached):
[1] compiler_3.5.3
[2] magrittr_1.5
[3] R6_2.4.0
[4] promises_1.0.1
[5] later_0.8.0
[6] htmltools_0.3.6
[7] tools_3.5.3
[8] Rcpp_1.0.1
[9] jsonlite_1.6
[10] digest_0.6.18
[11] xtable_1.8-3
[12] httpuv_1.5.1
[13] mime_0.6
I tried re-installing R v3.5.3 & latest RStudio v1.2.1335, it doesn't fix it.
What troubles me most is that some of the apps render all the images without any problem.
For example this one works alright : https://github.com/phileas-condemine/trafic_dataviz.drees
Is it because of the dependencies that somehow fix it ?
Back to shiny 1.2.0 & R 3.5.2 fixes the problem, all images are displayed correctly. So the "bug" either comes from shiny 1.3.1 or R 3.5.3
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=French_France.1252
[2] LC_CTYPE=French_France.1252
[3] LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C
[5] LC_TIME=French_France.1252
attached base packages:
[1] stats graphics
[3] grDevices utils
[5] datasets methods
[7] base
other attached packages:
[1] bsplus_0.1.1
[2] shinycssloaders_0.2.0
[3] markdown_0.9
[4] stringr_1.3.1
[5] shinyBS_0.61
[6] shinydashboard_0.7.1
[7] shinyjs_1.0
[8] V8_2.2
[9] shinyWidgets_0.4.4
[10] DT_0.5
[11] data.table_1.12.0
[12] dplyr_0.7.8
[13] shiny_1.2.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.0
[2] pillar_1.3.1
[3] compiler_3.5.2
[4] later_0.8.0
[5] bindr_0.1.1
[6] tools_3.5.2
[7] digest_0.6.18
[8] packrat_0.5.0
[9] lubridate_1.7.4
[10] jsonlite_1.6
[11] tibble_2.0.1
[12] pkgconfig_2.0.2
[13] rlang_0.3.1
[14] rstudioapi_0.9.0
[15] crosstalk_1.0.0
[16] yaml_2.2.0
[17] curl_3.3
[18] bindrcpp_0.2.2
[19] htmlwidgets_1.3
[20] tidyselect_0.2.5
[21] glue_1.3.0
[22] R6_2.3.0
[23] purrr_0.3.0
[24] magrittr_1.5
[25] scales_1.0.0
[26] promises_1.0.1
[27] htmltools_0.3.6
[28] assertthat_0.2.0
[29] mime_0.6
[30] xtable_1.8-3
[31] colorspace_1.4-0
[32] httpuv_1.5.1
[33] stringi_1.2.4
[34] munsell_0.5.0
[35] crayon_1.3.4
Related
I would like to save an R dataframe as a new table in an existing .mdb available here. I am getting an error message (below) and I suspect it has to do with .. ..$ supports.transactions: logi FALSE. I know I can save the dataframe as a .csv and import it into Access by hand. However, I would like my code to work for people who do not have Access software on their computer.
My connection is working and I'm able to dbReadTable from the .mdb. The .mdb I'm working with is I've tried
DBI::dbWriteTable(con,
"SSURGO_Soils_new",
value=newsoilexp)
as explained here, which results in
Error in new_result(connection#ptr, statement) :
nanodbc/nanodbc.cpp:1344: 42000: [Microsoft][ODBC Microsoft Access Driver] Syntax error in CREATE TABLE statement.
I've tried
DBI::dbWriteTable(con,
SQL("SSURGO_Soils_new"),
value=newsoilexp)
as suggested here, which results in
Error in connection_sql_tables(conn#ptr, catalog_name = if ("catalog" %in% :
nanodbc/nanodbc.cpp:4266: HYC00: [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented
Here is the DBI::dbGetInfo(con) output:
$dbname
[1] "C:\\SWAT\\ARCSWAT\\DATABASES\\SWAT_US_SSURGO_Soils_20190419.mdb"
$dbms.name
[1] "ACCESS"
$db.version
[1] "04.00.0000"
$username
[1] "admin"
$host
[1] ""
$port
[1] ""
$sourcename
[1] "mySSURGO"
$servername
[1] "ACCESS"
$drivername
[1] "ACEODBC.DLL"
$odbc.version
[1] "03.80.0000"
$driver.version
[1] "Microsoft Access database engine"
$odbcdriver.version
[1] "03.51"
$supports.transactions
[1] FALSE
attr(,"class")
[1] "ACCESS" "driver_info" "list"
And my sessionInfo()
R version 3.5.3 (2019-03-11)
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
[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] dbplyr_1.4.2 DBI_1.0.0 odbc_1.1.6 car_3.0-3 carData_3.0-2 dplyr_0.8.3
[7] ggsci_2.9 cowplot_1.0.0 ggpubr_0.2.2.999 magrittr_1.5 ggthemes_4.2.0 ggExtra_0.8
[13] devtools_2.1.0 usethis_1.5.1 ggplot2_3.1.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 prettyunits_1.0.2 ps_1.2.1 zeallot_0.1.0 assertthat_0.2.0
[6] rprojroot_1.3-2 digest_0.6.18 mime_0.6 cellranger_1.1.0 R6_2.3.0
[11] plyr_1.8.4 backports_1.1.4 httr_1.4.0 pillar_1.3.1 rlang_0.4.0
[16] readxl_1.3.1 lazyeval_0.2.1 curl_3.2 rstudioapi_0.8 data.table_1.12.2
[21] miniUI_0.1.1.1 blob_1.2.0 callr_3.3.1 desc_1.2.0 labeling_0.3
[26] stringr_1.3.1 foreign_0.8-72 bit_1.1-14 munsell_0.5.0 shiny_1.2.0
[31] compiler_3.5.3 httpuv_1.4.5 pkgconfig_2.0.2 pkgbuild_1.0.4 htmltools_0.3.6
[36] tidyselect_0.2.5 tibble_2.1.3 rio_0.5.16 crayon_1.3.4 withr_2.1.2
[41] later_0.7.5 grid_3.5.3 xtable_1.8-3 gtable_0.2.0 scales_1.0.0
[46] zip_2.0.3 cli_1.1.0 stringi_1.2.4 ggsignif_0.6.0 fs_1.3.1
[51] promises_1.0.1 remotes_2.1.0 testthat_2.2.1 vctrs_0.2.0 openxlsx_4.1.0.1
[56] tools_3.5.3 forcats_0.3.0 bit64_0.9-7 glue_1.3.0 purrr_0.2.5
[61] hms_0.4.2 abind_1.4-5 processx_3.4.1 pkgload_1.0.2 yaml_2.2.0
[66] colorspace_1.3-2 sessioninfo_1.1.1 memoise_1.1.0 haven_2.1.0
Will dbWriteTable() work properly if supports.transactions: TRUE? If so, how do I change it to TRUE? Or maybe something else is the problem. Neither the DBI or ODBC package manuals mention supports.transactions, so I suspect my problem is rather basic. Thanks in advance.
EDIT: This post does not address my question. That post uses the older pkg RODBC and deals with appending existing tables, not writing new ones.
When calling a function which uses mclapply() with Rscript myFuction.R --json=config.json the mclapply functions fails with message
all scheduled cores encountered errors in user code
However when I run the code within RStudio it runs fine. I'm developing on RStudio AWS AMI and testing in RStudio, and executing Rscript from the terminal of RStudio AWS machine, and the environments are the same between RStudio and the terminal.
Does anyone have an idea of extra parameters I might need to give to mclapply or other environment parameters I need to define when running mclapply with Rscript?
I've tried changing all the mclapply() arguments without success
Here is my environment.
R version 3.5.1 (2018-07-02)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Amazon Linux 2
Matrix products: default
BLAS/LAPACK: /anaconda3/envs/r35p27/lib/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats4 parallel stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] rlist_0.4.6.1 stringi_1.4.3
[3] stringr_1.3.1 seqinr_3.4-5
[5] rBLAST_0.99.2 ShortRead_1.40.0
[7] GenomicAlignments_1.18.1 SummarizedExperiment_1.12.0
[9] DelayedArray_0.8.0 matrixStats_0.54.0
[11] Biobase_2.42.0 Rsamtools_1.34.0
[13] GenomicRanges_1.34.0 GenomeInfoDb_1.18.1
[15] Biostrings_2.50.2 XVector_0.22.0
[17] IRanges_2.16.0 S4Vectors_0.20.1
[19] BiocParallel_1.16.6 BiocGenerics_0.28.0
[21] aws.s3_0.3.12 jsonlite_1.5
[23] configr_0.3.3 optparse_1.6.2
loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 RColorBrewer_1.1-2 compiler_3.5.1
[4] base64enc_0.1-3 bitops_1.0-6 tools_3.5.1
[7] zlibbioc_1.28.0 digest_0.6.20 lattice_0.20-35
[10] Matrix_1.2-14 yaml_2.2.0 GenomeInfoDbData_1.2.1
[13] hwriter_1.3.2 httr_1.3.1 xml2_1.2.0
[16] ade4_1.7-13 grid_3.5.1 getopt_1.20.2
[19] data.table_1.12.2 glue_1.3.1 R6_2.2.2
[22] latticeExtra_0.6-28 magrittr_1.5 MASS_7.3-51.4
[25] aws.signature_0.5.0 ini_0.3.1 RCurl_1.95-4.12
[28] RcppTOML_0.1.6
Although this is a "Warning message" mclapply quits
Warning messages:
1: In mclapply(1:dim(this.split)[1], BLAST.loop, mc.preschedule = TRUE) :
all scheduled cores encountered errors in user code
I am struggling with a strange behaviour of R/ggplot.
Starting a fresh R session and calling sessionInfo() gives
R version 3.5.1 (2018-07-02) Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 19
Matrix products: default BLAS:
/home/nicolai/anaconda3/lib/R/lib/libRblas.so LAPACK:
/home/nicolai/anaconda3/lib/R/lib/libRlapack.so
locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
LC_MONETARY=de_DE.UTF-8 [6] LC_MESSAGES=en_US.UTF-8
LC_PAPER=de_DE.UTF-8 LC_NAME=C LC_ADDRESS=C
LC_TELEPHONE=C [11] LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils
datasets methods base
other attached packages: [1] RevoUtils_11.0.1 RevoUtilsMath_11.0.0
loaded via a namespace (and not attached): [1] Rcpp_0.12.18
assertthat_0.2.0 dplyr_0.7.6 crayon_1.3.4 R6_2.2.2
grid_3.5.1 plyr_1.8.4 gtable_0.2.0 [9] magrittr_1.5
scales_0.5.0 ggplot2_3.0.0 pillar_1.3.0 rlang_0.2.1
lazyeval_0.2.1 rstudioapi_0.7 bindrcpp_0.2.2 [17] tools_3.5.1
glue_1.3.0 purrr_0.2.5 munsell_0.5.0 yaml_2.2.0
compiler_3.5.1 pkgconfig_2.0.1 colorspace_1.3-2 [25]
tidyselect_0.2.4 bindr_0.1.1 tibble_1.4.2
Notice how LC_NUMERIC is set to C.
Typing 1.2 returns
1.2
After calling the following two lines of code
library(ggplot2)
ggplot(data.frame(a=1:5, b=1:5), aes(a, b)) + geom_point()
My R-session mysteriously changes the decimal separator from a dot to a comma. Typing 1.2 returns
1,2
All plots I generate have the comma as the decimal separator. Calling sessionInfo() returns
R version 3.5.1 (2018-07-02) Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 19
Matrix products: default BLAS:
/home/nicolai/anaconda3/lib/R/lib/libRblas.so LAPACK:
/home/nicolai/anaconda3/lib/R/lib/libRlapack.so
locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=de_DE.UTF-8
LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5]
LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8
LC_PAPER=de_DE.UTF-8 LC_NAME=de_DE.UTF-8 [9]
LC_ADDRESS=de_DE.UTF-8 LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=de_DE.UTF-8
attached base packages: [1] stats graphics grDevices utils
datasets methods base
other attached packages: [1] ggplot2_3.0.0 RevoUtils_11.0.1
RevoUtilsMath_11.0.0
loaded via a namespace (and not attached): [1] Rcpp_0.12.18
rstudioapi_0.7 bindr_0.1.1 magrittr_1.5 tidyselect_0.2.4
munsell_0.5.0 colorspace_1.3-2 R6_2.2.2 [9] rlang_0.2.1
plyr_1.8.4 dplyr_0.7.6 tools_3.5.1 grid_3.5.1
gtable_0.2.0 withr_2.1.2 yaml_2.2.0 [17] lazyeval_0.2.1
assertthat_0.2.0 tibble_1.4.2 crayon_1.3.4 bindrcpp_0.2.2
purrr_0.2.5 glue_1.3.0 labeling_0.3 [25] compiler_3.5.1
pillar_1.3.0 scales_0.5.0 pkgconfig_2.0.1
Notice how the LC_NUMERIC value has changed. I assume this causes the change in the decimal separator, but I have no idea how that makes sense.
This is something that happened after installing a fresh Mint version together with a fresh, up-to-date R version.
Does someone have an idea of what could cause this?
I'm trying to run sparklyr from my local environment to replicate a production environment. However, I can't even get started. I successfully installed the latest version of Spark using spark_install(), but when trying to run spark_connect() I get this vague and unhelpful error.
> library(sparklyr)
> spark_installed_versions()
spark hadoop dir
1 2.3.1 2.7 C:\\Users\\...\\AppData\\Local/spark/spark-2.3.1-bin-hadoop2.7
> spark_connect(master = "local")
Error in if (is.na(a)) return(-1L) : argument is of length zero
Here is what my session info looks like.
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
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] sparklyr_0.8.4.9003
loaded via a namespace (and not attached):
[1] Rcpp_0.12.17 dbplyr_1.2.1 compiler_3.5.0 pillar_1.2.3 later_0.7.3
[6] plyr_1.8.4 bindr_0.1.1 base64enc_0.1-3 tools_3.5.0 digest_0.6.15
[11] jsonlite_1.5 tibble_1.4.2 nlme_3.1-137 lattice_0.20-35 pkgconfig_2.0.1
[16] rlang_0.2.1 psych_1.8.4 shiny_1.1.0 DBI_1.0.0 rstudioapi_0.7
[21] yaml_2.1.19 parallel_3.5.0 bindrcpp_0.2.2 stringr_1.3.1 dplyr_0.7.5
[26] httr_1.3.1 rappdirs_0.3.1 rprojroot_1.3-2 grid_3.5.0 tidyselect_0.2.4
[31] glue_1.2.0 R6_2.2.2 foreign_0.8-70 reshape2_1.4.3 purrr_0.2.5
[36] tidyr_0.8.1 magrittr_1.5 backports_1.1.2 promises_1.0.1 htmltools_0.3.6
[41] assertthat_0.2.0 mnormt_1.5-5 mime_0.5 xtable_1.8-2 httpuv_1.4.3
[46] config_0.3 stringi_1.1.7 lazyeval_0.2.1 broom_0.4.4
Well, with a bit of guessing I was able to solve my problem. I had to specify the "SPARK_HOME" environment manually.
spark_installed_versions()[1, 3] %>% spark_home_set()
When I do anything with my variables, for example: Y<-cbind(bank)or liq <-Liq, the error object not found appears. I guess, something is wrong with reading the excel file. I use library("readxl") and h<-read_xlsx("banks_NA.xlsx")to download the dataset.
Here is info about the session and data:
`>ls(h)
[1] "Da" "Dh_a" "Dh_l1" "Dh_m1" "Dl1" "Dm1"
[7] "K" "La_a" "La_l1" "La_m1" "Lh_a" "Lh_l1"
[13] "Lh_m1" "Liq" "Ll1" "Lm1" "Mac" "Na_Da"
[19] "OtR" "OtR_a" "PrT" "Pro" "S" "S_Bl"
[25] "S_Bo" "S_S" "bank" "date" "dis" "foreign"
[31] "live" "rD" "rL" "rQi" "rS" "rSc"
[37] "rSi" "region" "state" "ta"`
`> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] sandwich_2.4-0 readxl_1.1.0 plm_1.6-6
[4] openxlsx_4.0.17 gplots_3.0.1 Formula_1.2-2
[7] foreign_0.8-70 class_7.3-14 caTools_1.17.1
[10] car_3.0-0 carData_3.0-1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.16 cellranger_1.1.0 pillar_1.2.2
[4] compiler_3.5.0 forcats_0.3.0 bitops_1.0-6
[7] miscTools_0.6-22 tools_3.5.0 tibble_1.4.2
[10] nlme_3.1-137 lattice_0.20-35 rlang_0.2.0
[13] cli_1.0.0 maxLik_1.3-4 curl_3.2
[16] haven_1.1.1 rio_0.5.10 gtools_3.5.0
[19] lmtest_0.9-36 grid_3.5.0 data.table_1.10.4-3
[22] bdsmatrix_1.3-3 gdata_2.18.0 magrittr_1.5
[25] MASS_7.3-50 assertthat_0.2.0 abind_1.4-5
[28] KernSmooth_2.23-15 utf8_1.1.3 crayon_1.3.4
[31] zoo_1.8-1`
Yesterday, I did exactly the same operations and everything worked perfectly. Today I decided to update R studio and now everything is corrupted...