I am writing a shiny app on my local computer (ISO-8859-1 is system default encoding). When I save ui.R with this encoding and I try to run the app an error related to non-UTF-8 encoding creeps up. So, I save the file with UTF-8 encoding and the app works if I don't have special characters in the file.
The special characters are mexican accents (á, é, í, ó) which supposedly are supported by UTF-8.
If I save the file with UTF-8 and open it again, I get these characters translated into rubbish (?A, etc).
I'm not sure what I am missing.
> 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
[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] broom_0.4.1 knitr_1.15.1 data.table_1.10.0 reshape2_1.4.2 RODBC_1.3-14 tse.sql_0.1.0
[7] memisc_0.99.7-1 MASS_7.3-45 lattice_0.20-34 foreign_0.8-67 magrittr_1.5 ggplot2_2.2.1
[13] inegiR_1.2.0 dplyr_0.5.0 tse.utils_0.1.0 shiny_0.14.2
loaded via a namespace (and not attached):
[1] zoo_1.7-13 splines_3.3.2 colorspace_1.2-7 sourcetools_0.1.5 htmltools_0.3.5 yaml_2.1.14
[7] mgcv_1.8-15 base64enc_0.1-3 XML_3.98-1.5 nloptr_1.0.4 DBI_0.5-1 plyr_1.8.4
[13] stringr_1.1.0 MatrixModels_0.4-1 munsell_0.4.3 gtable_0.2.0 psych_1.6.9 evaluate_0.10
[19] SparseM_1.74 httpuv_1.3.3 quantreg_5.29 pbkrtest_0.4-6 parallel_3.3.2 Rcpp_0.12.7
[25] xtable_1.8-2 scales_0.4.1 backports_1.0.4 jsonlite_1.2 mime_0.5 lme4_1.1-12
[31] mnormt_1.5-5 digest_0.6.10 stringi_1.1.2 grid_3.3.2 rprojroot_1.1 tools_3.3.2
[37] lazyeval_0.2.0 tibble_1.2 tidyr_0.6.0 car_2.1-4 Matrix_1.2-7.1 assertthat_0.1
[43] minqa_1.2.4 rmarkdown_1.3 R6_2.2.0 nnet_7.3-12 nlme_3.1-128
Thanks to a comment: (https://stackoverflow.com/users/4395383/ujjwal-kumar). Seems like an rstudio thing, just tried reopening with another encoding...
Related
On Windows 10, I am getting the following error with blogdown::new_site() function:
Hugo has been installed to "C:\Users\hp\AppData\Roaming\Hugo\0.89.4".
You are recommended to set options(blogdown.hugo.version = "0.89.4")
in the .Rprofile file in your website project. See the blogdown book
for more info on .Rprofile:
https://bookdown.org/yihui/blogdown/global-options.html
Error: 'system3' is not an exported object from 'namespace:xfun'
I'm wondering what am I missing here? Any hints.
sessionInfo()
R version 4.1.2 (2021-11-01)
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
[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] xfun_0.28
loaded via a namespace (and not attached):
[1] compiler_4.1.2 tools_4.1.2 blogdown_1.6.5 pacman_0.5.1
I don't know how you managed to install the dev version of blogdown without installing the dev version of xfun at the same time, since the latter is required (as specified in DESCRIPTION). Per installation instruction in README, this is how you install the dev version of blogdown:
remotes::install_github('rstudio/blogdown')
And the dev version of xfun should be installed automatically (note that you will need RTools).
FYI I get the exact same error trying to following the TL;DR section of this blog and that is after explicitly updating the xfun package. Here is the entire code segment I am trying to run:
remotes::install_github("rstudio/blogdown")
usethis::create_project()
blogdown::new_site(theme = "wowchemy/starter-academic")
and here is the error I am getting:
09:14:26 > blogdown::new_site(theme = "wowchemy/starter-academic")
― Creating your new site
| Installing Hugo
The latest Hugo version is v0.90.1
trying URL 'https://github.com/gohugoio/hugo/releases/download/v0.90.1/hugo_extended_0.90.1_macOS-ARM64.tar.gz'
Content type 'application/octet-stream' length 16102460 bytes (15.4 MB)
==================================================
downloaded 15.4 MB
Hugo has been installed to "/Users/rogerbos/Library/Application Support/Hugo/0.90.1".
Error: 'system3' is not an exported object from 'namespace:xfun'
09:14:26 >
and here is my sessionInfo():
9:14:26 > sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.0.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] datasets utils stats graphics grDevices methods base
other attached packages:
[1] alphavantager_0.1.2 googlesheets4_1.0.0 googledrive_2.0.0
[4] clipr_0.7.1 jsonlite_1.7.2 stringi_1.7.6
[7] dtplyr_1.1.0 data.table_1.14.2 dplyr_1.0.7
[10] plyr_1.8.6 testthat_3.1.0 lubridate_1.8.0
[13] timeDate_3043.102 sendmailR_1.2-1 rmarkdown_2.11
[16] devtools_2.4.2 usethis_2.1.3 xts_0.12.1
[19] zoo_1.8-9 MASS_7.3-54 fortunes_1.5-4
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 lattice_0.20-45 prettyunits_1.1.1
[4] ps_1.6.0 assertthat_0.2.1 rprojroot_2.0.2
[7] digest_0.6.29 utf8_1.2.2 R6_2.5.1
[10] cellranger_1.1.0 evaluate_0.14 blogdown_1.6.5
[13] httr_1.4.2 pillar_1.6.4 rlang_0.4.12
[16] curl_4.3.2 rstudioapi_0.13 callr_3.7.0
[19] desc_1.4.0 compiler_4.1.2 xfun_0.28
[22] pkgconfig_2.0.3 askpass_1.1 base64enc_0.1-3
[25] pkgbuild_1.2.0 htmltools_0.5.2 openssl_1.4.5
[28] tidyselect_1.1.1 tibble_3.1.5 bookdown_0.24
[31] fansi_0.5.0 crayon_1.4.2 withr_2.4.2
[34] rappdirs_0.3.3 grid_4.1.2 lifecycle_1.0.1
[37] DBI_1.1.1 magrittr_2.0.1 cli_3.1.0
[40] cachem_1.0.6 fs_1.5.0 remotes_2.4.1
[43] ellipsis_0.3.2 vctrs_0.3.8 generics_0.1.1
[46] tools_4.1.2 glue_1.5.1 purrr_0.3.4
[49] processx_3.5.2 pkgload_1.2.3 fastmap_1.1.0
[52] gargle_1.2.0 sessioninfo_1.2.1 memoise_2.0.0
[55] knitr_1.36
I am trying to read a svg image (created with inkscape) with magick in R. From the introduction here, imagemagick can read svg image.
This is the svg image that I am trying to read.
https://www.dropbox.com/s/3dqcr7qr286m1k5/image.svg?dl=0
library(magrittr)
library(magick)
i <- "image.svg"
myimage <- image_read(i)
myimage
I can read the image successfully, but when I view the image in the Rstudio viewer, the image has some distortions especially in the labels.
Is there a way to avoid such distortions in svg image?
My Sys.info
sysname release
"Windows" "10 x64"
version nodename
"build 19041" "SUMANKHANAL"
machine login
"x86-64" "suman"
user effective_user
"suman" "suman"
sessionInfo
R version 4.0.3 (2020-10-10)
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
[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
[4] utils datasets methods
[7] base
other attached packages:
[1] magick_2.5.2 magrittr_2.0.1
[3] reprex_0.3.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 rstudioapi_0.13
[3] knitr_1.30 whisker_0.4
[5] R6_2.4.1 rlang_0.4.10
[7] tools_4.0.3 xfun_0.20
[9] tinytex_0.26 clipr_0.7.0
[11] htmltools_0.5.0 ellipsis_0.3.1
[13] digest_0.6.27 tibble_3.0.3
[15] lifecycle_0.2.0 crayon_1.3.4
[17] processx_3.4.4 callr_3.5.1
[19] vctrs_0.3.5 fs_1.5.0
[21] ps_1.3.4 evaluate_0.14
[23] rmarkdown_2.5 compiler_4.0.3
[25] pillar_1.4.6 pkgconfig_2.0.3
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
I want to import a .biom file in R that I've dowloaded from the ftp server - the Earth Microbiome Project (release 1).
The file comes from the following link: ftp://ftp.microbio.me/emp/release1/otu_tables/closed_ref_silva/
I tried with several of these files but the one I want to import in R (studio) is the first one: 'emp_cr_silva_16S_123.qc_filtered.biom' (293MB)
I've tried several things:
I tried to open it with both the phyloseq::import_biome and the bioformat::read_biom functions :
emp<-import_biom(BIOMfilename = biom.file)
I got the following Error message:
Both attempts to read input file:
E:/Path/to/my/data/EMP_data/emp_cr_silva_16S_123.qc_filtered.biom
either as JSON (BIOM-v1) or HDF5 (BIOM-v2).
Check file path, file name, file itself, then try again.
I then checked the file path and name with the is_file function of the 'fs' package.
Then I checked the .biom file I want to import, openning this .biom file with Notepad shows strange characters (sorry but I am not familiar with developing) such as:
ƒOB§ß;}]0v(ÿQ<ãï8 #OÅ+q8‚´'Ž;º‹ë®Ü-¯§-‡ùP
I had a look at other biom files I have but none of them look like this. I try to open these other files with the same function and it works.
I tried to obtain this file from other repositories (https://zenodo.org/record/890000) but have a similar problem.
The problem most likely comes from the file format but I don't know how to deal with this.
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] biomformat_1.8.0 phyloseq_1.24.2 fs_1.3.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 bindr_0.1.1 compiler_3.5.0 pillar_1.4.2
[5] plyr_1.8.4 XVector_0.20.0 iterators_1.0.9 tools_3.5.0
[9] zlibbioc_1.26.0 jsonlite_1.6 tibble_2.1.3 nlme_3.1-137
[13] rhdf5_2.24.0 gtable_0.2.0 lattice_0.20-35 mgcv_1.8-24
[17] pkgconfig_2.0.2 rlang_0.4.0 igraph_1.2.4.1 Matrix_1.2-14
[21] foreach_1.4.4 rstudioapi_0.10 yaml_2.1.19 parallel_3.5.0
[25] bindrcpp_0.2.2 dplyr_0.7.6 stringr_1.3.1 cluster_2.0.7-1
[29] Biostrings_2.48.0 S4Vectors_0.20.1 IRanges_2.14.10 multtest_2.36.0
[33] tidyselect_0.2.5 stats4_3.5.0 ade4_1.7-11 grid_3.5.0
[37] glue_1.3.1 Biobase_2.40.0 data.table_1.12.2 R6_2.4.0
[41] survival_2.42-3 purrr_0.2.5 reshape2_1.4.3 Rhdf5lib_1.2.1
[45] ggplot2_3.2.0 magrittr_1.5 splines_3.5.0 scales_1.0.0
[49] codetools_0.2-15 MASS_7.3-50 BiocGenerics_0.26.0 assertthat_0.2.0
[53] permute_0.9-4 ape_5.1 colorspace_1.4-1 stringi_1.1.7
[57] lazyeval_0.2.1 munsell_0.5.0 vegan_2.5-5 crayon_1.3.4 ```
The .biom file is encrypted, complessed or mislabled, so I don't think you will be able to use it this way.
A usable version should look like examples given here:
http://biom-format.org/documentation/format_versions/biom-1.0.html
You could ask the owners of the file if they could provide you with a correct version.
I'm trying to run a shiny app that works perfectly well when I run it locally but not when I try and run it on a shiny web server. When I try and access it through the browser all I get is the following error message:
ERROR: 'restoreInput' is not an exported object from 'namespace:shiny'
I'm aware that a question regarding this error message has previously been asked here: Shinydashboard: 'restoreInput' is not an exported object from 'namespace:shiny' but I believe that person was running the app locally so my question is distinct from their's. Nevertheless I have obviously tried to implement all of the solutions provided for that answer which are basically just "ensure you have the latest version of R and the latest version of the required packages". I've done this and when I ssh into the shiny server and source my ui and server scripts and then call sessionInfo() this is the output:
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shinydashboard_0.6.1 shinythemes_1.1.1 ggplot2_2.2.1
[4] raster_2.6-7 sp_1.2-7 leaflet_1.1.0
[7] shiny_1.0.5
loaded via a namespace (and not attached):
[1] Rcpp_0.12.15 magrittr_1.5 munsell_0.4.3 colorspace_1.3-2
[5] xtable_1.8-2 lattice_0.20-35 R6_2.2.2 rlang_0.2.0
[9] plyr_1.8.4 grid_3.4.3 gtable_0.2.0 htmltools_0.3.6
[13] crosstalk_1.0.0 yaml_2.1.17 lazyeval_0.2.1 digest_0.6.15
[17] tibble_1.4.2 htmlwidgets_1.0 mime_0.5 compiler_3.4.3
[21] pillar_1.2.1 scales_0.5.0 httpuv_1.3.6.1
which is almost identical to the output I get when I call sessionInfo() in my local version of R in which the app runs seamlessly. See below:
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shinydashboard_0.6.1 shinythemes_1.1.1 ggplot2_2.2.1 raster_2.6-7
[5] sp_1.2-6 leaflet_1.1.0 shiny_1.0.5
loaded via a namespace (and not attached):
[1] Rcpp_0.12.14 magrittr_1.5 munsell_0.4.3 colorspace_1.3-2 xtable_1.8-2
[6] lattice_0.20-35 R6_2.2.2 rlang_0.1.2 plyr_1.8.4 tools_3.4.3
[11] rgdal_1.2-16 grid_3.4.3 gtable_0.2.0 rgeos_0.3-26 htmltools_0.3.6
[16] crosstalk_1.0.0 yaml_2.1.14 lazyeval_0.2.1 digest_0.6.14 tibble_1.3.4
[21] htmlwidgets_0.9 rsconnect_0.8.5 mime_0.5 compiler_3.4.3 scales_0.5.0
[26] jsonlite_1.5 httpuv_1.3.5
What's particularly strange is that initially when I ssh-ed into the shiny server and sourced the ui.R file I was getting this same error message. After updating R and all the packages this doesn't happen anymore but I still get the same error when I try and open the app in the browser. I added the following lines to the start of both my server and ui scripts to ensure that it was using the correct version of R and the up-to-date packages.
loc <- '/path/to/location/of/correct/r/packages'
.libPaths(c(loc, .libPaths()))
Can anybody advise me as to what might be going on or how best to troubleshoot?