Can't access existing MonetDB with dplyr - r

I created a MonetDBLite database yesterday, populated it, and was accessing it with dplyr, however this morning I don't seem able to use dplyr.
Here's my connection:
statcast_db <- MonetDBLite::src_monetdblite("/Users/williampetti/statcast_database/statcast_db_Monet", create = FALSE)
And here's a simple query for the statcast_17 table:
statcast_db %>%
tbl("statcast_17") %>%
select(game_date) %>%
distinct() %>%
collect() %>%
tail(n = 1)
Yesterday, this worked fine. This morning, I get this error:
Error in UseMethod("db_query_fields") :
no applicable method for 'db_query_fields' applied to an object of class "MonetDBEmbeddedConnection"
If I use a simple dbGetQuery call, however, it works fine:
> dbGetQuery(statcast_db$con, "SELECT game_date FROM statcast_17 ORDER BY game_date DESC LIMIT 1")
game_date
1 2017-04-29
Here's my session info:
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)
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] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xml2_1.1.1 baseballr_0.3.1 RSQLite_1.0.0 pacman_0.4.1
[5] dplyr_0.5.0 purrr_0.2.2 readr_1.0.0 tidyr_0.6.0
[9] tibble_1.2 ggplot2_2.2.1 tidyverse_1.0.0 magrittr_1.5
[13] MonetDBLite_0.3.1 RMySQL_0.10.9 DBI_0.5-1
loaded via a namespace (and not attached):
[1] splines_3.3.1 lattice_0.20-33 colorspace_1.2-6
[4] htmltools_0.3.5 mgcv_1.8-12 chron_2.3-47
[7] XML_3.98-1.6 survival_2.40-1 hexbin_1.27.1
[10] foreign_0.8-66 RColorBrewer_1.1-2 plyr_1.8.4
[13] stringr_1.2.0 munsell_0.4.3 gtable_0.2.0
[16] rvest_0.3.2 XML2R_0.0.6 codetools_0.2-14
[19] latticeExtra_0.6-28 knitr_1.14 reldist_1.6-6
[22] htmlTable_1.7 Rcpp_0.12.9 acepack_1.4.1
[25] scales_0.4.1 pitchRx_1.8.2 Hmisc_4.0-0
[28] gridExtra_2.2.1 digest_0.6.11 stringi_1.1.3
[31] grid_3.3.1 tools_3.3.1 bitops_1.0-6
[34] lazyeval_0.2.0 RCurl_1.95-4.8 Formula_1.2-1
[37] cluster_2.0.4 MASS_7.3-45 Matrix_1.2-6
[40] data.table_1.9.6 lubridate_1.6.0 httr_1.2.1
[43] assertthat_0.1 R6_2.1.3 rpart_4.1-10
[46] nnet_7.3-12 nlme_3.1-128

I just replied to a similar question this morning after figuring out that the order in which you load MonetDBLite matters. I came across this question trying to figure out why it does matter. I was having the same type of Error in UseMethod problems as BillPetti. Making sure MonetDBLite loads after dplyr and dbplyr has resolved the issue for me. Here's the link to that other answer:
https://stackoverflow.com/a/53307673/3705612

Related

ggparagraph is not displayed

I have problem with the function ggparagraph() from ggpubr package. Its content is not drawing. If I use the function:
example(ggparagraph)
The plot is drawing without any problem, but the "ggparagraph area" (below plot) is empty. The same problem is if I use custom scripts, where the ggparagraph is applied.
R does not print any error message. Where can be the problem?
My session info is:
sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 15063)
Matrix products: default
locale:
1 LC_COLLATE=Slovak_Slovakia.1250 LC_CTYPE=Slovak_Slovakia.1250
[3] LC_MONETARY=Slovak_Slovakia.1250 LC_NUMERIC=C
[5] LC_TIME=Slovak_Slovakia.1250
attached base packages:
1 stats graphics grDevices utils datasets methods base
other attached packages:
1 ggpubr_0.1.4 magrittr_1.5 gridExtra_2.2.1 dplyr_0.7.2
[5] purrr_0.2.3 readr_1.1.1 tidyr_0.6.3 tibble_1.3.3
[9] ggplot2_2.2.1 tidyverse_1.1.1
loaded via a namespace (and not attached):
1 Rcpp_0.12.12 cellranger_1.1.0 compiler_3.4.1 plyr_1.8.4
[5] bindr_0.1 forcats_0.2.0 tools_3.4.1 jsonlite_1.5
[9] lubridate_1.6.0 nlme_3.1-131 gtable_0.2.0 lattice_0.20-35
[13] pkgconfig_2.0.1 rlang_0.1.2 psych_1.7.5 parallel_3.4.1
[17] haven_1.1.0 bindrcpp_0.2 xml2_1.1.1 stringr_1.2.0
[21] httr_1.2.1 hms_0.3 cowplot_0.8.0 grid_3.4.1
[25] glue_1.1.1 R6_2.2.2 readxl_1.0.0 foreign_0.8-69
[29] reshape2_1.4.2 modelr_0.1.1 scales_0.4.1 rvest_0.3.2
[33] assertthat_0.2.0 mnormt_1.5-5 colorspace_1.3-2 labeling_0.3
[37] stringi_1.1.5 lazyeval_0.2.0 munsell_0.4.3 broom_0.4.2
Finally, I don't find where is the problem, but if I install this package from github (instead of CRAN), all paragraphs are rendered correctly.

Function not found, though package installed an attached

im tryring to run dcc.est from the ccgarch-package.
Even though I installed the package and attached it with library(ccgarch), I get the following error:
library(ccgarch)
dcc <- dcc.est(dvar, param)
Error: could not find function "dcc.est"
I also tried the following:
dcc <- ccgarch::dcc.est(dvar, param)
Error: object 'dcc.est' is not exported by 'namespace:ccgarch'
Accordingly to the vignette of ccgarch version 0.2.3 (https://cran.r-project.org/web/packages/ccgarch/ccgarch.pdf) , dcc.est is part of the package. What am I doing wrong?
See my sessionInfobelow:
> 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=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] pracma_1.9.5 kerdiest_1.2 evir_1.7-3 chron_2.3-48 date_1.2-35
[6] fGarch_3010.82.1 fBasics_3011.87 timeSeries_3022.101.2 timeDate_3012.100 rugarch_1.3-6
[11] tsDyn_0.9-44 ccgarch_0.2.3 gdata_2.17.0 gtools_3.5.0 tidyr_0.6.0
[16] dplyr_0.5.0
loaded via a namespace (and not attached):
[1] rgl_0.96.0 Rcpp_0.12.8 mvtnorm_1.0-5 lattice_0.20-34
[5] zoo_1.7-14 assertthat_0.1 digest_0.6.10 lmtest_0.9-34
[9] foreach_1.4.3 mime_0.5 truncnorm_1.0-7 R6_2.2.0
[13] plyr_1.8.4 tseriesChaos_0.1-13 ggplot2_2.2.0 lazyeval_0.2.0
[17] misc3d_0.8-4 fracdiff_1.4-2 nloptr_1.0.4 SkewHyperbolic_0.3-2
[21] Matrix_1.2-7.1 htmlwidgets_0.8 munsell_0.4.3 shiny_0.14.2
[25] numDeriv_2016.8-1 httpuv_1.3.3 DistributionUtils_0.5-1 mnormt_1.5-5
[29] forecast_7.3 urca_1.3-0 mgcv_1.8-15 htmltools_0.3.5
[33] vars_1.5-2 nnet_7.3-12 Rsolnp_1.16 multicool_0.1-10
[37] expm_0.999-0 tibble_1.2 quadprog_1.5-5 codetools_0.2-15
[41] MASS_7.3-45 GeneralizedHyperbolic_0.8-1 grid_3.3.2 nlme_3.1-128
[45] jsonlite_1.1 xtable_1.8-2 gtable_0.2.0 DBI_0.5-1
[49] magrittr_1.5 scales_0.4.1 KernSmooth_2.23-15 tseries_0.10-36
[53] xts_0.9-7 sandwich_2.3-4 spd_2.0-1 iterators_1.0.8
[57] tools_3.3.2 ks_1.10.4 colorspace_1.3-2 knitr_1.15.1
If you look at the NAMESPACE you see that dcc.est is commented out (it may have be replaced by dcc.estimation - just a guess, I've never used the package?).
This means it is not exported by the package, but it's still there, only as an internal function. You can access internal functions by using 3 colons
ccgarch:::dcc.est
As it's in the documentation I think somewhere along the line of updates and releases someone forgot to remove it properly, or un-comment it again in the export list.

Shiny Apps Error in R Studio

My Shiny apps had been running fine until last week.
I am trying to run the apps today and getting errors in most of them :
Below is the error and my sessionInfo.
I am using Shinydashboard and other shiny libraries to render an app.
Error in withReactiveDomain(shinysession, { :
No handler registered for for type file1:shiny.file
sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.1 (Yosemite)
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] parallel stats4 grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] locfit_1.5-9.1 ggbiplot_0.55 scales_0.4.0
[4] chimera_1.14.0 Homo.sapiens_1.3.1 org.Hs.eg.db_3.3.0
[7] GO.db_3.3.0 OrganismDbi_1.14.1 TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2
[10] GenomicFeatures_1.24.5 BSgenome.Hsapiens.UCSC.hg19_1.4.0 BSgenome_1.40.1
[13] rtracklayer_1.32.2 AnnotationDbi_1.34.4 GenomicAlignments_1.8.4
[16] Rsamtools_1.24.0 Biostrings_2.40.2 XVector_0.12.1
[19] BiocInstaller_1.22.3 gTrack_0.1.0 gUtils_0.2.0
[22] data.table_1.9.6 stringr_1.1.0 devtools_1.12.0
[25] reshape_0.8.5 DESeq2_1.12.4 SummarizedExperiment_1.2.3
[28] Biobase_2.32.0 GenomicRanges_1.24.3 GenomeInfoDb_1.8.7
[31] IRanges_2.6.1 S4Vectors_0.10.3 BiocGenerics_0.18.0
[34] xlsx_0.5.7 xlsxjars_0.6.1 rJava_0.9-8
[37] shinydashboard_0.5.3 DT_0.2 shiny_0.14.1
[40] ggplot2_2.1.0 sva_3.20.0 genefilter_1.54.2
[43] mgcv_1.8-15 nlme_3.1-128 matrixStats_0.51.0
[46] pvclust_2.0-0 gplots_3.0.1 reshape2_1.4.1
[49] plyr_1.8.4 ComplexHeatmap_1.11.7
loaded via a namespace (and not attached):
[1] colorspace_1.2-7 rjson_0.2.15 class_7.3-14 modeltools_0.2-21 mclust_5.2
[6] circlize_0.3.9 GlobalOptions_0.0.10 flexmix_2.3-13 mvtnorm_1.0-5 splines_3.3.1
[11] robustbase_0.92-6 geneplotter_1.50.0 Formula_1.2-1 jsonlite_1.1 annotate_1.50.1
[16] cluster_2.0.5 kernlab_0.9-25 graph_1.50.0 httr_1.2.1 Matrix_1.2-7.1
[21] acepack_1.3-3.3 htmltools_0.3.5 tools_3.3.1 gtable_0.2.0 Rcpp_0.12.7
[26] trimcluster_0.1-2 gdata_2.17.0 fpc_2.1-10 mime_0.5 gtools_3.5.0
[31] XML_3.98-1.4 dendextend_1.3.0 DEoptimR_1.0-6 zlibbioc_1.18.0 MASS_7.3-45
[36] RBGL_1.48.1 RColorBrewer_1.1-2 yaml_2.1.13 curl_2.1 memoise_1.0.0
[41] gridExtra_2.2.1 biomaRt_2.28.0 rpart_4.1-10 latticeExtra_0.6-28 stringi_1.1.2
[46] RSQLite_1.0.0 caTools_1.17.1 BiocParallel_1.6.6 shape_1.4.2 chron_2.3-47
[51] prabclus_2.2-6 bitops_1.0-6 lattice_0.20-34 htmlwidgets_0.7 labeling_0.3
[56] magrittr_1.5 R6_2.2.0 Hmisc_3.17-4 DBI_0.5-1 whisker_0.3-2
[61] foreign_0.8-67 withr_1.0.2 survival_2.39-5 RCurl_1.95-4.8 nnet_7.3-12
[66] KernSmooth_2.23-15 GetoptLong_0.1.5 git2r_0.15.0 digest_0.6.10 diptest_0.75-7
[71] xtable_1.8-2 httpuv_1.3.3 munsell_0.4.3
Any idea,what this could be?
Thanks,
Ron
Shiny version 0.14.2 was published last week (along with new versions of R and RStudio). Maybe this broke something in your code. One way to protect against this is to use something like packrat package that locks in a certain version of an R package so that your code is not changed by a new package. You can then test your code against an upgrade and troubleshoot before using that new version.
Restarting R studio worked.There was no need to update any packages.

MLSeq package error

I would like to use MLSeq package but I am getting this error.
library(MLSeq)
Error : object ‘bag.default’ is not exported by 'namespace:caret'
Error: package or namespace load failed for ‘MLSeq’
How can I overcome this error?
sessionInfo() R version 3.3.1 (2016-06-21) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.12.1 (Sierra)
Output:
locale: [1]
en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages: [1] parallel stats4 stats graphics
grDevices utils datasets methods base
other attached packages: [1] edgeR_3.14.0
randomForest_4.6-12 limma_3.28.21 DESeq2_1.12.4
SummarizedExperiment_1.2.3 Biobase_2.32.0
GenomicRanges_1.24.3 [8] GenomeInfoDb_1.8.7
IRanges_2.6.1 S4Vectors_0.10.3
BiocGenerics_0.18.0 caret_6.0-72 ggplot2_2.1.0
lattice_0.20-34
loaded via a namespace (and not attached): [1] Rcpp_0.12.7
locfit_1.5-9.1 digest_0.6.10 foreach_1.4.3
plyr_1.8.4 chron_2.3-47 acepack_1.4.1
MatrixModels_0.4-1 RSQLite_1.0.0 [10] zlibbioc_1.18.0
minqa_1.2.4 data.table_1.9.6 annotate_1.50.1
SparseM_1.72 car_2.1-3 nloptr_1.0.4
rpart_4.1-10 Matrix_1.2-7.1 [19] splines_3.3.1
lme4_1.1-12 BiocParallel_1.6.6 geneplotter_1.50.0
stringr_1.1.0 foreign_0.8-67 RCurl_1.95-4.8
munsell_0.4.3 mgcv_1.8-15 [28] htmltools_0.3.5
nnet_7.3-12 gridExtra_2.2.1 htmlTable_1.7
Hmisc_4.0-0 codetools_0.2-15 XML_3.98-1.4
MASS_7.3-45 bitops_1.0-6 [37] ModelMetrics_1.1.0
grid_3.3.1 nlme_3.1-128 xtable_1.8-2
gtable_0.2.0 DBI_0.5-1 magrittr_1.5
scales_0.4.0 stringi_1.1.2 [46] XVector_0.12.1
reshape2_1.4.2 genefilter_1.54.2 latticeExtra_0.6-28
Formula_1.2-1 RColorBrewer_1.1-2 iterators_1.0.8
tools_3.3.1 pbkrtest_0.4-6 [55] survival_2.40-1
AnnotationDbi_1.34.4 colorspace_1.2-7 cluster_2.0.5
knitr_1.14 quantreg_5.29
The error arises from importing "bag.default" function in caret. NAMESPACE is fixed in the development version 1.15.1. You can download the source files from https://github.com/Bioconductor-mirror/MLSeq. With the upcoming version 1.16.0, namespace error will be fixed in the released version.

GSEA-R error R Mac OSX El Capitan

Not sure how many people still use the R script for GSEA, but when I try and load the script and its functions:
GSEA.program.location <- ("file location of GSEA.1.0.R")
source(GSEA.program.location, verbose=T, max.deparse.length=9999)
I get this error
'envir' chosen:<environment: R_GlobalEnv>
encoding = "native.enc" chosen
Error: '\%' is an unrecognized escape in character string starting ""Tag \%"
I believe I have to remove the backspace, but I have searched through GSEA.1.0.R, and the "source" function source code, and I can't find this '\%'. What is it that I am doing wrong?
Session info:
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.1 (El Capitan)
locale:
[1] C/C/C/C/C/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] biomaRt_2.26.0 WGCNA_1.48 RSQLite_1.0.0 DBI_0.3.1 fastcluster_1.1.16 dynamicTreeCut_1.62
loaded via a namespace (and not attached):
[1] reshape2_1.4.1 splines_3.2.2 lattice_0.20-33 colorspace_1.2-6 htmltools_0.2.6
[6] stats4_3.2.2 yaml_2.1.13 survival_2.38-3 XML_3.98-1.3 foreign_0.8-66
[11] BiocGenerics_0.16.1 RColorBrewer_1.1-2 matrixStats_0.15.0 foreach_1.4.3 plyr_1.8.3
[16] stringr_1.0.0 munsell_0.4.2 gtable_0.1.2 codetools_0.2-14 latticeExtra_0.6-26
[21] Biobase_2.30.0 IRanges_2.4.1 doParallel_1.0.10 parallel_3.2.2 AnnotationDbi_1.32.0
[26] preprocessCore_1.32.0 GSEABase_1.32.0 proto_0.3-10 Rcpp_0.12.1 acepack_1.3-3.3
[31] xtable_1.8-0 scales_0.3.0 S4Vectors_0.8.1 Hmisc_3.17-0 graph_1.48.0
[36] annotate_1.48.0 gridExtra_2.0.0 impute_1.44.0 ggplot2_1.0.1 digest_0.6.8
[41] stringi_1.0-1 grid_3.2.2 tools_3.2.2 bitops_1.0-6 magrittr_1.5
[46] RCurl_1.95-4.7 Formula_1.2-1 cluster_2.0.3 GO.db_3.2.2 MASS_7.3-45
[51] rmarkdown_0.8.1 iterators_1.0.8 rpart_4.1-10 nnet_7.3-11
These warnings occur when you have R version 2.5 and higher installed. To fix, remove the single backslashes in front of these characters as there is no need to escape them in R versions 2.5 and higher.

Resources