runehaubo / lmerTestR

Repository for the R-package lmerTest
48 stars 9 forks source link

R session aborted when random effects are included #53

Open Anaherasm opened 8 months ago

Anaherasm commented 8 months ago

Hello, I am Ana, and I am starting to use lmer in R. However, every time I try to do a test with random effects, the R session aborts. Perhaps the fact that I have to have administration permission when I execute r and R studio is related to this issue.

This is my R session info _R version 4.3.1 (2023-06-16 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale: [1] LC_COLLATE=Spanish_Spain.utf8 LC_CTYPE=Spanish_Spain.utf8
[3] LC_MONETARY=Spanish_Spain.utf8 LC_NUMERIC=C
[5] LC_TIME=Spanish_Spain.utf8

time zone: Europe/Madrid tzcode source: internal

attached base packages: [1] stats4 stats graphics grDevices utils datasets methods base

other attached packages: [1] lmerTest_3.1-3 lme4_1.1-34 Matrix_1.6-1.1
[4] emmeans_1.8.9 lubridate_1.9.3 forcats_1.0.0
[7] stringr_1.5.0 dplyr_1.1.3 purrr_1.0.2
[10] readr_2.1.4 tidyr_1.3.0 tibble_3.2.1
[13] tidyverse_2.0.0 RColorBrewer_1.1-3 vegan_2.6-4
[16] lattice_0.21-9 permute_0.9-7 rstatix_0.7.2
[19] scales_1.2.1 microbiome_1.22.0 ggplot2_3.4.4
[22] Biostrings_2.68.1 GenomeInfoDb_1.36.4 XVector_0.40.0
[25] IRanges_2.34.1 S4Vectors_0.38.2 BiocGenerics_0.46.0 [28] phyloseq_1.44.0

loaded via a namespace (and not attached): [1] bitops_1.0-7 sandwich_3.0-2 rlang_1.1.1
[4] magrittr_2.0.3 multcomp_1.4-25 ade4_1.7-22
[7] compiler_4.3.1 mgcv_1.9-0 vctrs_0.6.3
[10] reshape2_1.4.4 pkgconfig_2.0.3 crayon_1.5.2
[13] backports_1.4.1 utf8_1.2.3 tzdb_0.4.0
[16] nloptr_2.0.3 zlibbioc_1.46.0 jsonlite_1.8.7
[19] biomformat_1.28.0 rhdf5filters_1.12.1 Rhdf5lib_1.22.1
[22] broom_1.0.5 parallel_4.3.1 cluster_2.1.4
[25] R6_2.5.1 stringi_1.7.12 car_3.1-2
[28] boot_1.3-28.1 numDeriv_2016.8-1.1 estimability_1.4.1
[31] Rcpp_1.0.11 iterators_1.0.14 zoo_1.8-12
[34] splines_4.3.1 igraph_1.5.1 timechange_0.2.0
[37] tidyselect_1.2.0 rstudioapi_0.15.0 abind_1.4-5
[40] codetools_0.2-19 plyr_1.8.9 Biobase_2.60.0
[43] withr_2.5.1 Rtsne_0.16 survival_3.5-7
[46] pillar_1.9.0 carData_3.0-5 foreach_1.5.2
[49] generics_0.1.3 RCurl_1.98-1.12 hms_1.1.3
[52] munsell_0.5.0 minqa_1.2.6 xtable_1.8-4
[55] glue_1.6.2 tools_4.3.1 data.table_1.14.8
[58] mvtnorm_1.2-3 rhdf5_2.44.0 grid_4.3.1
[61] ape_5.7-1 colorspace_2.1-0 nlme_3.1-163
[64] GenomeInfoDbData_1.2.10 cli_3.6.1 fansi_1.0.5
[67] gtable_0.3.4 digest_0.6.33 TH.data_1.1-2
[70] multtest_2.56.0 lifecycle_1.0.3 MASS7.3-60

And my code:

#SCRIPT FOR ANALYSING PIGLET'S FECES 
setwd("C:/Users/anade/qiime2_2022/copyso")

#install.packages("RColorBrewer")
packs_sows <- as.vector(c("phyloseq","Biostrings","ggplot2",
                          "microbiome","scales","rstatix","vegan","RColorBrewer","tidyverse"))

lapply(packs_sows, require, character.only = TRUE)
#remotes::install_github("rvlenth/emmeans")
install.packages("lme4",repos=c("http://lme4.r-forge.r-project.org/repos",
                         getOption("repos")[["CRAN"]]))
install.packages("lmerTest")
library(emmeans)
library(lme4)
library(lmerTest)

load("C:/Users/anade/qiime2_2022/copyso/rarefied.RData")

############All samples###############
rich_genus <-  estimate_richness(genus_ps_rarefied)
rownames(rich_genus) <- substr(rownames(rich_genus),2,nchar(rownames(rich_genus)))
metadata<- as.data.frame(genus_ps_rarefied@sam_data)
rich_merged_genus <- merge(rich_genus,metadata, by.x = 0, by.y =0)
write.csv(rich_merged_genus, "rich_merged_genus.csv")

##Analysis
#Treatment
observed_treatment<-lmerTest::lmer(Observed ~ treatment + bw_class + time + (1|ID_SUBJECT), rich_merged_genus)
summary(lm1)

Also, I obtain the following messages with lm4 and lmerTest:

library(lme4) Loading required package: Matrix

Attaching package: ‘Matrix’

The following objects are masked from ‘package:tidyr’:

expand, pack, unpack

The following object is masked from ‘package:S4Vectors’:

expand

library(lmerTest)

Attaching package: ‘lmerTest’

The following object is masked from ‘package:lme4’:

lmer

The following object is masked from ‘package:stats’:

step

Thank you all for your help