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

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...

Related

How to install rgdal and/or upload raster on google-collaboration

I am trying to upload several rasters on tif format with google-collaboration. However I always had the same error message:
"Cannot create RasterLayer object from this file; perhaps you need to install rgdal first"
So, I tried to install rgdal...and another error appeared:
"Installation of package had non-zero exit status."
I tried to install using a local file, and apparently, its run ok, however, when i required the package, another error appeared:
"Error in library(rgdal) : there is no package called ‘rgdal’
/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/init.py:146: RRuntimeWarning: 4:
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/init.py:146: RRuntimeWarning: 5:
warnings.warn(x, RRuntimeWarning)
/usr/local/lib/python3.6/dist-packages/rpy2/rinterface/init.py:146: RRuntimeWarning: 6: package ‘rgdal’ is not available (for R version 3.6.1)"
Could anyone help me to fix these errors?
I provide my session info and a fragment of code
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas/liblapack.so.3
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
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] parallel tools stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] snowfall_1.84-6.1 snow_0.4-3 biomod2_3.3-7.1 ggplot2_3.2.1
[5] reshape_0.8.8 raster_2.9-23 sp_1.3-1
loaded via a namespace (and not attached):
[1] gbm_2.1.5 zoo_1.8-6 tidyselect_0.2.5
[4] purrr_0.3.2 splines_3.6.1 lattice_0.20-38
[7] colorspace_1.4-1 viridisLite_0.3.0 survival_2.44-1.1
[10] rlang_0.4.0 hexbin_1.27.3 pillar_1.4.2
[13] glue_1.3.1 withr_2.1.2 RColorBrewer_1.1-2
[16] plotmo_3.5.5 plyr_1.8.4 mda_0.4-10
[19] munsell_0.5.0 gtable_0.3.0 codetools_0.2-16
[22] latticeExtra_0.6-28 class_7.3-15 Rcpp_1.0.2
[25] scales_1.0.0 plotrix_3.7-6 abind_1.4-5
[28] gridExtra_2.3 TeachingDemos_2.10 dplyr_0.8.3
[31] dismo_1.1-4 rasterVis_0.46 grid_3.6.1
[34] magrittr_1.5 lazyeval_0.2.2 tibble_2.1.3
[37] PresenceAbsence_1.1.9 randomForest_4.6-14 Formula_1.2-3
[40] crayon_1.3.4 pkgconfig_2.0.2 MASS_7.3-51.4
[43] Matrix_1.2-17 pROC_1.15.3 assertthat_0.2.1
[46] earth_5.1.1 R6_2.4.0 rpart_4.1-15
[49] nnet_7.3-12 compiler_3.6.1
%load_ext rpy2.ipython
from google.colab import drive
drive.mount('/content/drive/')
%%R
install.packages("rgdal", dependencies=TRUE,repos='http://cran.rstudio.com/')
library(rgdal)
library(raster)
myExpl.EUR <- stack(list.files("/content/drive/My Drive/Sycios/",pattern=".tif",full.names=TRUE))
Thank you very much in advance
Try this from the command line
sudo apt-get update
sudo apt-get install libgdal-dev libproj-dev
And then in R
install.packages("rgdal")

Error when Using BiomartGeneRegionTrack in cummeRbund package

I am trying to plot a gene of interest using cummeRbund package. Using this script:
biomTrack<-BiomartGeneRegionTrack(genome=genome, chromosome=as.character(myChr), start=myStart, end=myEnd, name="ENSEMBL", showId=T)
I encountered this error:
Error in .getBiomart(genome) :
Gviz thinks that the UCSC genome identifier 'hg38' should map to the current Biomart head as 'GRCh38', but its current version is 'GRCh38.p5'.
Please manually provide biomaRt object.
using useMart("ensembl",dataset="hsapiens_gene_ensembl") also couldn't help. Would you please tell me how can I fix this?
Here is the sessionInfo()
> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
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] grid stats4 parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] biomaRt_2.28.0 cummeRbund_2.14.0 Gviz_1.16.1 rtracklayer_1.32.1 GenomicRanges_1.24.2
[6] GenomeInfoDb_1.8.1 IRanges_2.6.0 S4Vectors_0.10.1 fastcluster_1.1.20 reshape2_1.4.1
[11] ggplot2_2.1.0 RSQLite_1.0.0 DBI_0.4-1 BiocGenerics_0.18.0
loaded via a namespace (and not attached):
[1] SummarizedExperiment_1.2.3 VariantAnnotation_1.18.1 splines_3.3.0
[4] lattice_0.20-33 colorspace_1.2-6 htmltools_0.3.5
[7] GenomicFeatures_1.24.2 chron_2.3-47 interactiveDisplayBase_1.10.3
[10] XML_3.98-1.4 survival_2.39-4 foreign_0.8-66
[13] ensembldb_1.4.2 BiocParallel_1.6.2 RColorBrewer_1.1-2
[16] matrixStats_0.50.2 plyr_1.8.4 stringr_1.0.0
[19] zlibbioc_1.18.0 Biostrings_2.40.2 munsell_0.4.3
[22] gtable_0.2.0 latticeExtra_0.6-28 Biobase_2.32.0
[25] BiocInstaller_1.22.2 httpuv_1.3.3 AnnotationDbi_1.34.3
[28] Rcpp_0.12.5 xtable_1.8-2 acepack_1.3-3.3
[31] BSgenome_1.40.1 scales_0.4.0 Hmisc_3.17-4
[34] XVector_0.12.0 mime_0.4 Rsamtools_1.24.0
[37] gridExtra_2.2.1 AnnotationHub_2.4.2 digest_0.6.9
[40] stringi_1.1.1 biovizBase_1.20.0 shiny_0.13.2
[43] tools_3.3.0 bitops_1.0-6 magrittr_1.5
[46] RCurl_1.95-4.8 dichromat_2.0-0 Formula_1.2-1
[49] cluster_2.0.4 Matrix_1.2-6 data.table_1.9.6
[52] httr_1.2.0 R6_2.1.2 rpart_4.1-10
[55] GenomicAlignments_1.8.3 nnet_7.3-12

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.

Suppressing readOGR Messages in knitr [duplicate]

This question already has answers here:
In R and knitr, can I suppress the message of readOGR?
(3 answers)
Closed 7 years ago.
I wonder how to suppress readOGR error messages in knitr. My MWE is below:
\documentclass{article}
\begin{document}
<< Test >>=
library(rgdal)
dsn <- system.file("vectors", package = "rgdal")[1]
setwd(dsn)
cities <- readOGR(dsn=dsn, layer="cities")
#
\end{document}
The function readOGR gives the message like this:
OGR data source with driver: ESRI Shapefile
Source: "/home/asd/R/i686-pc-linux-gnu-library/3.2/rgdal/vectors", layer: "cities"
with 606 features
It has 4 fields
But I want to suppress this message. I tried message=FALSE, but it did not work for me.
Edited
sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 14.04.2 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] grid tools stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggmap_2.4 mapproj_1.2-2 maps_2.3-9 leaflet_1.0.0 rgeos_0.3-11 rgdal_1.0-4
[7] maptools_0.8-36 sp_1.1-1 Hmisc_3.16-0 Formula_1.2-1 survival_2.38-2 lattice_0.20-31
[13] psych_1.5.4 ggbiplot_0.55 plyr_1.8.3 gplots_2.17.0 rsm_2.7-2 scales_0.2.5
[19] ggplot2_1.0.1 xtable_1.7-4 highr_0.5 knitr_1.10.12 brew_1.0-6 stringr_1.0.0
loaded via a namespace (and not attached):
[1] RColorBrewer_1.1-2 jsonlite_0.9.16 reshape2_1.4.1 cluster_2.0.2 rstudioapi_0.3.1
[6] magrittr_1.5 acepack_1.3-3.3 gtable_0.1.2 htmltools_0.2.6 splines_3.2.1
[11] dplyr_0.4.2 KernSmooth_2.23-14 htmlwidgets_0.5 gridExtra_0.9.1 R6_2.0.1
[16] digest_0.6.8 colorspace_1.2-6 proto_0.3-10 stringi_0.5-2 yaml_2.1.13
[21] lazyeval_0.1.10.9000 evaluate_0.7 labeling_0.3 RJSONIO_1.3-0 gdata_2.16.1
[26] rpart_4.1-9 munsell_0.4.2 DBI_0.3.1 Rcpp_0.11.6 RgoogleMaps_1.2.0.7
[31] png_0.1-7 MASS_7.3-41 parallel_3.2.1 assertthat_0.1 rjson_0.2.15
[36] caTools_1.17.1 gtools_3.5.0 jpeg_0.1-8 latticeExtra_0.6-26 foreign_0.8-63
[41] bitops_1.0-6 nnet_7.3-9 geosphere_1.3-13 formatR_1.2 mnormt_1.5-3
Just add verbose=FALSE to the readOGR call to suppress the messages (which are helpful during an interactive session but are cruft when in scripts or notebooks).
Try this:
<<Test, message=FALSE, results='hide', echo=FALSE>>=

DESeq2 - Invalid class “GRangesList” object

I've just updated my DESeq2 package from version 1.4.5 to version 1.6.3 and my scripts are no longer working. Specifically, I get the following error when generating a DESeqDataSet object with the function DESeqDataSetFromMatrix:
Error in validObject(.Object) :
invalid class “GRangesList” object: number of rows in DataTable 'mcols(x)' must match length of 'x'
To replicate this error one may either use the example shown in the DESeq2 vignette:
library("pasilla")
library("Biobase")
data("pasillaGenes")
countData <- counts(pasillaGenes)
colData <- pData(pasillaGenes)[,c("condition","type")]
dds <- DESeqDataSetFromMatrix(countData = countData,
colData = colData,
design = ~ condition)
or the example shown in the DESeq2 Reference Manual:
countData <- matrix(1:4,ncol=2)
colData <- data.frame(condition=factor(c("a","b")))
dds <- DESeqDataSetFromMatrix(countData, colData, formula(~ condition))
Thanks in advance for your help,
Alessia
sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-unknown-linux-gnu (64-bit)
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] parallel stats4 stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] DESeq2_1.6.3 RcppArmadillo_0.4.400.0 Rcpp_0.11.2
[4] GenomicRanges_1.16.4 GenomeInfoDb_1.0.2 IRanges_1.22.10
[7] S4Vectors_0.4.0 BiocGenerics_0.12.1 BiocInstaller_1.16.1
loaded via a namespace (and not attached):
[1] acepack_1.3-3.3 annotate_1.42.1 AnnotationDbi_1.26.0
[4] BatchJobs_1.3 BBmisc_1.7 Biobase_2.24.0
[7] BiocParallel_0.6.1 brew_1.0-6 checkmate_1.4
[10] cluster_1.15.3 codetools_0.2-9 colorspace_1.2-4
[13] DBI_0.3.0 digest_0.6.4 fail_1.2
[16] foreach_1.4.2 foreign_0.8-61 Formula_1.1-2
[19] genefilter_1.46.1 geneplotter_1.42.0 ggplot2_1.0.0
[22] grid_3.1.0 gtable_0.1.2 Hmisc_3.14-5
[25] iterators_1.0.7 lattice_0.20-29 latticeExtra_0.6-26
[28] locfit_1.5-9.1 MASS_7.3-34 munsell_0.4.2
[31] nnet_7.3-8 plyr_1.8.1 proto_0.3-10
[34] RColorBrewer_1.0-5 reshape2_1.4 rpart_4.1-8
[37] RSQLite_0.11.4 scales_0.2.4 sendmailR_1.1-2
[40] splines_3.1.0 stringr_0.6.2 survival_2.37-7
[43] tools_3.1.0 XML_3.98-1.1 xtable_1.7-4
[46] XVector_0.4.0
source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.0 (BiocInstaller 1.16.1), ?biocLite for help

Resources