covaruber / sommer

36 stars 23 forks source link

Error in H.mat(A, G) #13

Closed luansheng closed 3 years ago

luansheng commented 3 years ago

When I try to run the example for H.mat() in RStudio Server, an error happened: M <- matrix(rep(0,200*1000),200,1000) for (i in 1:200) { M[i,] <- sample(c(-1,0,0,1), size=1000, replace=TRUE) } rownames(M) <- 1:nrow(M) v <- sample(1:nrow(M),100) M2 <- M[v,]

A <- A.mat(M) # assume this is a pedigree-based matrix for the sake of example G <- A.mat(M2)

H <- H.mat(A,G) Error in H.mat(A, G) : subtraction: incompatible matrix dimensions: 0x0 and 100x100

sessionInfo(): R version 3.6.3 (2020-02-29) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.5 LTS

Matrix products: default BLAS/LAPACK: /opt/intel/compilers_and_libraries_2020.1.217/linux/mkl/lib/intel64_lin/libmkl_rt.so

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] sommer_4.1.2 crayon_1.3.4 lattice_0.20-41 MASS_7.3-53 Matrix_1.2-18

loaded via a namespace (and not attached): [1] compiler_3.6.3 tools_3.6.3 rstudioapi_0.11 yaml_2.2.0 Rcpp_1.0.5 grid_3.6.3

However, these codes can be run normally in the same RStudio Desktop version.

sessionInfo() R version 3.6.3 (2020-02-29) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.5 LTS

Matrix products: default BLAS/LAPACK: /opt/intel/compilers_and_libraries_2020.1.217/linux/mkl/lib/intel64_lin/libmkl_rt.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] sommer_4.1.2 crayon_1.3.4 lattice_0.20-41 MASS_7.3-53
[5] Matrix_1.3-0

loaded via a namespace (and not attached): [1] compiler_3.6.3 tools_3.6.3 Rcpp_1.0.5 grid_3.6.3

covaruber commented 3 years ago

Sorry for my late response @luansheng I cannot replicate the error. Could be that the Rstudio server has different math libraries than the desktop? When you get an error about 0x0 dimensions it means that a matrix calculation couldn't be done so that's why I think this error may happen.

luansheng commented 3 years ago

I am using the Intel MKL math library on the Ubuntu 18.04 server. Is it not ok using it? BLAS/LAPACK: /opt/intel/compilers_and_libraries_2020.1.217/linux/mkl/lib/intel64_lin/libmkl_rt.so

Sheng Luan

From: Gio Covarrubias Sent: 2021年1月30日 3:37 To: covaruber/sommer Cc: Sheng Luan; Mention Subject: Re: [covaruber/sommer] Error in H.mat(A, G) (#13)

Sorry for my late response @luansheng I cannot replicate the error. Could be that the Rstudio server has different math libraries than the desktop? When you get an error about 0x0 dimensions it means that a matrix calculation couldn't be done so that's why I think this error may happen. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

covaruber commented 3 years ago

Dear Sheng Luan, unfortunately this is not a sommer issue but something related to your settings. I will close this issue and I recommend you to move your issue to other forum. Thanks.