Shinydashboard: 'restoreInput' is not an exported object from 'namespace:shiny' - r

I am using RStudio to create a new Shiny app. I copy and paste the code sample from https://rdrr.io/cran/shinydashboard/man/renderValueBox.html into the app.R. I receive this error:
Warning: Error in : 'restoreInput' is not an exported object from 'namespace:shiny'
Stack trace (innermost first):
45: getExportedValue
44: ::
43: dashboardSidebar
42: inherits
41: tagAssert
40: dashboardPage
1: runApp
Error : 'restoreInput' is not an exported object from 'namespace:shiny'
Here is my sessionInfo() output:
R version 3.3.3 (2017-03-06)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 25 (Workstation Edition)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_0.13.0 shinydashboard_0.6.0 dplyr_0.5.0 readr_1.0.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.3 digest_0.6.9 assertthat_0.1 mime_0.4 grid_3.3.3
[6] plyr_1.8.4 R6_2.1.2 jsonlite_0.9.19 xtable_1.8-0 gtable_0.2.0
[11] DBI_0.5-1 magrittr_1.5 scales_0.4.1 ggplot2_2.2.1 lazyeval_0.2.0
[16] tools_3.3.3 munsell_0.4.3 httpuv_1.3.3 colorspace_1.3-2 htmltools_0.3.5
[21] tibble_1.2
UPDATE:
1) I tried the sample from a different machine and produced the same error.
2) I also took a shinydashboard skeleton app and reproduced this error.

Ran update.packages() and newer versions didn't have this issue.

Related

Calling mclapply from Rscript

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

Kernel Crash when using Fill function ggplot

I am using R 3.5.1 on a stand-alone environment and whenever I use the fill parameter in ggplot, the kernel crashes. When i remove the fill parameter, the plot works fine. This worked on an older set up (no specs available). I also tried just saving using ggsave, and I get the same error message.
Error messgage when running in native R
*** caught illegal operation ***
address 0x7f3019a29703, cause 'illegal operand'
Traceback:
1: id(data[disc], drop = TRUE)
2: add_group(evaled)
3: f(..., self = self)
4: l$compute_aesthetics(d, plot)
5: f(l = layers[[i]], d = data[[i]])
6: by_layer(function(l, d) l$compute_aesthetics(d, plot))
7: ggplot_build.ggplot(x)
8: ggplot_build(x)
9: print.ggplot(x)
10: function (x, ...) UseMethod("print")(x)
SessionInfo:
R version 3.5.1 (2018-07-02)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /opt/anaconda3/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] stats graphics grDevices utils datasets methods base
other attached packages:
[1] stringr_1.4.0 reshape2_1.4.3 ggplot2_3.2.0 dplyr_0.8.1 tidyr_0.8.3
[6] DBI_1.0.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 withr_2.1.2 crayon_1.3.4 assertthat_0.2.1
[5] plyr_1.8.4 grid_3.5.1 R6_2.4.0 gtable_0.3.0
[9] magrittr_1.5 scales_1.0.0 pillar_1.4.2 stringi_1.2.4
[13] rlang_0.4.0 lazyeval_0.2.2 tools_3.5.1 glue_1.3.1
[17] purrr_0.3.2 munsell_0.5.0 compiler_3.5.1 pkgconfig_2.0.2
[21] colorspace_1.4-1 tidyselect_0.2.5 tibble_2.1.3
Thanks in advance!

'filter' from dplyr package causes error message

I run queries to ClickHouse database (connected with Rserver by RClickhouse package). Queries run smoothly unless I use filter function - which generates error message about wrong object type
Important detail: this problem appears only in Rstudio project that is located in common server folder. Same code works fine (without errors) in similar project that shares parent folder (/users/boris/) with R
> a <- con %>% tbl("test_sample") %>% select(domain) %>% collect()
> show(a)
# A tibble: 140,000 x 1
domain
* <chr>
1 allforchildren.ru
> a <- con %>% tbl("test_sample") %>% filter(domain == "wildberries.ru") %>% collect()
Error in storage.mode(x) <- "double" :
(list) object cannot be coerced to type 'double'
Any guesses what is the reason for such reaction on filter function?
P.S. session info
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.7.0
LAPACK: /usr/lib/lapack/liblapack.so.3.7.0
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] stats graphics grDevices utils datasets methods base
other attached packages:
[1] urltools_1.7.1 dplyr_0.7.6 getPass_0.2-2
[4] DBI_1.0.0 RClickhouse_0.4.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.18 dbplyr_1.2.2 crayon_1.3.4 assertthat_0.2.0
[5] R6_2.2.2 magrittr_1.5 pillar_1.3.0 rlang_0.2.1
[9] rstudioapi_0.7 bindrcpp_0.2.2 tools_3.5.1 glue_1.3.0
[13] triebeard_0.3.0 purrr_0.2.5 compiler_3.5.1 yaml_2.2.0
[17] pkgconfig_2.0.1 bindr_0.1.1 tidyselect_0.2.4 tibble_1.4.2

Facing difficulties in regression with mxnet in R

I was following this tutorial http://mxnet.io/tutorials/r/fiveMinutesNeuralNetwork.html#regression
Everything worked accordingly but when I changed:
fc1 <- mx.symbol.FullyConnected(data, num_hidden=1)
to
fc1 <- mx.symbol.FullyConnected(data, num_hidden=2)
And among the stacks of error logs I thought may be this is the most interesting:
Error in exec$update.arg.arrays(arg.arrays, match.name, skip.null) :
[20:22:59] src/ndarray/ndarray.cc:239: Check failed: from.shape() == to->shape()
shape mismatchfrom.shape = (20,) to.shape=(20,2)
How do I diagnose this problem?
Here is the output of sessionInfo():
R version 3.3.3 RC (2017-02-27 r72279)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C 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 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mlbench_2.1-1 mxnet_0.9.5
loaded via a namespace (and not attached):
[1] igraph_1.0.1 Rcpp_0.12.10 rstudioapi_0.6 magrittr_1.5 munsell_0.4.3 colorspace_1.3-2
[7] viridisLite_0.2.0 R6_2.2.0 brew_1.0-6 stringr_1.2.0 plyr_1.8.4 dplyr_0.5.0
[13] visNetwork_1.0.3 Rook_1.1-1 tools_3.3.3 grid_3.3.3 gtable_0.2.0 DBI_0.6
[19] influenceR_0.1.0 DiagrammeR_0.9.0 htmltools_0.3.5 lazyeval_0.2.0 digest_0.6.12 assertthat_0.1
[25] tibble_1.2 gridExtra_2.2.1 RColorBrewer_1.1-2 ggplot2_2.2.1 codetools_0.2-8 htmlwidgets_0.8
[31] viridis_0.4.0 rgexf_0.15.3 stringi_1.1.3 scales_0.4.1 XML_3.98-1.6 jsonlite_1.3
The thing is that below the fc1 <- mx.symbol.FullyConnected(data, num_hidden=1) line, tutorial uses linear regression for the output lro <- mx.symbol.LinearRegressionOutput(fc1).
LinearRegressionOutput is used to compute the l2-loss between it's input symbol and the labels provided to it. It assumes 1 label per example, and passing 2 breaks it. In my case it is a little bit different from your message, maybe because the difference in versions:
Error in symbol$infer.shape(list(...)) :
Error in operator linearregressionoutput5: Shape inconsistent, Provided=(20,), inferred shape=(20,2)
Fixing of this depends of what exactly you want to achieve. If you are solving classification task and want to receive probabilities for both classes, then you need to use Softmax:
fc1 <- mx.symbol.FullyConnected(data, num_hidden=2)
lro <- mx.symbol.SoftmaxOutput(fc1)

Error : object ‘sigma’ is not exported by 'namespace:lme4'

After updating lme4 (1.1-12), I'm getting this error when I invoke varComp package.
library(varComp)
Error : object ‘sigma’ is not exported by 'namespace:lme4'
Error: package or namespace load failed for ‘varComp’
Edited
Here is my sessionInfo()
sessionInfo()
R version 3.3.0 beta (2016-03-30 r70404)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 14.04.3 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C 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 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lme4_1.1-12 Matrix_1.2-4 devtools_1.11.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.4 Formula_1.2-1 roxygen2_5.0.1.9000 magrittr_1.5 cluster_2.0.3
[6] MASS_7.3-45 mutoss_0.1-10 splines_3.3.0 BiocGenerics_0.12.1 mnormt_1.5-4
[11] xtable_1.8-2 colorspace_1.2-6 lattice_0.20-33 R6_2.1.2 quadprog_1.5-5
[16] parallel_3.3.0 broom_0.4.0 latticeExtra_0.6-28 coda_0.18-1 TH.data_1.0-7
[21] withr_1.0.1 MatrixModels_0.4-1 assertthat_0.1 digest_0.6.9 multtest_2.22.0
[26] acepack_1.3-3.3 StroupGLMM_0.1.0 phia_0.2-1 scales_0.4.0 lsmeans_2.23
[31] Hmisc_3.17-3 lmerTest_2.0-30 stats4_3.3.0 survey_3.30-3 munsell_0.4.3
[36] multcomp_1.4-4 minqa_1.2.4 plyr_1.8.3 dplyr_0.4.3.9000 stringr_1.0.0
[41] car_2.1-2 tools_3.3.0 grid_3.3.0 nnet_7.3-12 pbkrtest_0.4-6
[46] nlme_3.1-127 Biobase_2.26.0 gtable_0.2.0 mgcv_1.8-12 quantreg_5.21
[51] psych_1.5.8 plotrix_3.6-1 DBI_0.3.1 survival_2.39-2 gridExtra_2.2.1
[56] ggplot2_2.1.0 tidyr_0.4.1 nloptr_1.0.4 reshape2_1.4.1 RColorBrewer_1.1-2
[61] codetools_0.2-14 rpart_4.1-10 aod_1.3 memoise_1.0.0 sandwich_2.3-4
[66] stringi_1.0-1 estimability_1.1-1 CompQuadForm_1.4.1 mvtnorm_1.0-5 SparseM_1.7
[71] foreign_0.8-66 zoo_1.7-12
The varComp package depends on RLRsim. RLRsim uses the S3 generic sigma, which was moved from lme4 to stats in R 3.3.0. If you use a Windows binary for RLRsim built under R < 3.3.0, then RLRsim will look for sigma in lme4 instead on in stats:
> install.packages("https://cran.r-project.org/bin/windows/contrib/3.2/RLRsim_3.1-2.zip", repos=NULL)
...
package ‘RLRsim’ successfully unpacked and MD5 sums checked
> library(varComp)
Error : object ‘sigma’ is not exported by 'namespace:lme4'
Error: package or namespace load failed for ‘varComp’
If you reinstall RLRsim you should get a recent build and varComp will load:
> install.packages("RLRsim")
...
package ‘RLRsim’ successfully unpacked and MD5 sums checked
...
> library(varComp)
>
I'm not sure if this is an answer or a workaround, but for me stating #' #imoprt package instead of #' #importFrom package function as an roxygen docstring did the trick. Faulty versioning, I guess...

Resources