Hi,
I have been using the Posit Workbench. The msm package was properly installed. however, that is producing the following error while loding the package. Any suggestion would be highly appreciated. Thanks
library(msm)
Error: package or namespace load failed for ‘msm’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/mnt/efs/home/ID.../R/x86_64-pc-linux-gnu-library/4.3/expm/libs/expm.so':
libRlapack.so: cannot open shared object file: No such file or directory
I think you are misreading @ Gabor's message. He thinks it is the {expm} package that is broken. {msm} is supposed to import it but that may not be working properly.
Just different enough that I am not sure how to interpret it. but I do notice that you seem to have an older version of LAPACK installed v. 3.9.0 versus my v.3.12.0 which maybe making a difference.
I've never seen Amazon Linux so I am just guessing even more than usual but you might want to check to see if there is a newer version for your Linux.
BTW, can I ask you to paste code or output between
```
```
rather than doing screenshots? It, usually, makes your code more readable and, if need be, it is easy to copy and paste.
Seems like you are installing Linux binary packages from a custom repository, and some of these are not compatible with your R installation.
If you have access to a regular CRAN repo or source packages, then try to install expm from source. This will compile it against the libraries you actually have. E.g. this might work if you have access to the CRAN repo:
Thanks!
Installedexpm follwed by mvtnorm and msm from the same repository the error differs. However, installing from a different repository results in the same error as before. Unsure how to proceed.
> library(msm)
Error: package or namespace load failed for ‘msm’ in get(Info[i, 1], envir = env):
lazy-load database '/mnt/efs/home/user/R/x86_64-pc-linux-gnu-library/4.3/mvtnorm/R/mvtnorm.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
The package mvtnorm loading also gives the same error.
> library(mvtnorm)
Error: package or namespace load failed for ‘mvtnorm’ in get(Info[i, 1], envir = env):
lazy-load database '/mnt/efs/home/user/R/x86_64-pc-linux-gnu-library/4.3/mvtnorm/R/mvtnorm.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
Thanks so much!
Restarting improves the functionality a lot, but some issues remain. I get one warning repeated 25 times and an error. MSM functions work, but I’m unsure of the error’s impact in future. Appreciate your thoughts.
> library(msm)
There were 25 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In get(method, envir = home) : internal error -3 in R_decompress1
...
25: In get(method, envir = home) : internal error -3 in R_decompress1
Error in fetch(key) :
lazy-load database '/mnt/efs/home/user/R/x86_64-pc-linux-gnu-library/4.3/msm/help/msm.rdb' is corrupt
msm functions working fine so far!
> statetable.msm(state, PTNUM, data=cav)
to
from 1 2 3 4
1 1367 204 44 148
2 46 134 54 48
3 4 13 107 55
>
> Q <- rbind ( c(0, 0.25, 0, 0.25),
+ c(0.166, 0, 0.166, 0.166),
+ c(0, 0.25, 0, 0.25),
+ c(0, 0, 0, 0) )
>
> cav.msm <- msm( state ~ years, subject=PTNUM, data = cav,
+ qmatrix = Q, deathexact = 4)
> summary(cav.msm)
Observed numbers of individuals occupying states at each time
State 1 State 2 State 3 State 4 Total
0 622 0 0 0 622
1.94602739726027 537 4 5 54 600
3.89205479452054 356 35 24 87 502
5.83808219178081 208 41 28 127 404
7.78410958904108 122 44 27 158 351
9.73013698630135 71 25 22 187 305
11.6761643835616 31 11 13 218 273
13.6221917808219 12 6 5 236 259
15.5682191780822 5 1 3 244 253
17.5142465753424 1 0 2 249 252
19.4602739726027 0 0 0 251 251
Expected numbers of individuals occupying states at each time
...
This still seems like a broken msm installation. Close all your R sessions, and then reinstall msm in a clean R session, without any packages loaded.
You can also try pak, (see All about installing pak. — Installing pak • pak), it unloads packages automatically before installation, and it also detects if the package is loaded in another R session.