0

I would like to use blavaan (version 0.3-5) for my analysis. Installing the package blavaan seems to work (i.e., no error messages), but when I try to load the library 'blavaan', I receive the following error message:

Error: package or namespace load failed for ‘blavaan’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘pkgbuild’

This is the error message I receive in the newest version of R (3.6.1). I checked, and it appears af if the package pkgbuild may not compatible with this version. Therefore, I tried an older version of R (3.5.3) in which blavaan was created. So then it should work, right? But then again I receive a similar error message. This time for a package called vctrs.

For some background: I have experience with lavaan ('regular' SEM), and wanted to give blavaan a try. I know my way around lavaan and basic R, but I am not a programmer/mathematician or something like that. I think the best solution for me is to just use a version of R that others know will work, rather than having to program my way around.

This is the code I used, but I don't think that is the issue:

install.packages("blavaan", dep = TRUE)

library(blavaan)

After installing 'blavaan', I get the following message:

package ‘blavaan’ successfully unpacked and MD5 sums checked The downloaded binary packages are in [location]

However, after opening the library 'blavaan', I receive the following error:

Error: package or namespace load failed for ‘blavaan’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘pkgbuild’ [or 'vctrs' etc.]

I have only just started using blavaan (or: trying to...), so I only have tried the newest version of blavaan (0.3-5) that was updated on August 3rd, 2019.

Has anybody since then used blavaan? And if so, which version of R did you use?

Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55
Mar-05
  • 1
  • 1
    I can install and use it on R 3.6.1 without any issues. Since the package [passes the CRAN checks](https://cran.r-project.org/web/checks/check_results_blavaan.html) it definitely works with the current R version and there is no reason to use an older R version (but good reasons not to, e.g., if you don't build packages from source). – Roland Aug 07 '19 at 07:13
  • Did you, during installing, get any messages regarding failing installations for dependencies? – Roland Aug 07 '19 at 07:18
  • Roland, yes i did receive the following message: Warning: dependency ‘genefilter’ is not available. It is good to know that it works for you in R 3.6.1, thank you. – Mar-05 Aug 07 '19 at 07:35
  • I found that the dependency genefilter is part of Bioconductor, which can be installed using the following code: install.packages("BiocManager") library("BiocManager") BiocManager::install("genefilter") But then, when installing genefilter, it cannot unzip: Error in unzip(zipname, exdir = dest) : Once I have installed genefilter, is this then automatically available to the blavaan package? Or do I have to take an additional step? – Mar-05 Aug 07 '19 at 07:44
  • blaavan works for me and I don't have genefilter installed. A CRAN package should not have a Bioconductor package as dependency (and as far as I can see blaavan doesn't). – Roland Aug 07 '19 at 07:48
  • Thank you for your reply. Do you have any recommendations for me? – Mar-05 Aug 07 '19 at 07:52
  • Have you done `update.packages(checkBuilt = TRUE, ask = FALSE)` after updating R? Maybe try `remove.packages("blavaan"); update.packages(checkBuilt = TRUE, ask = FALSE); install.packages("blaavan")`? And pay close attention to any messages (warnings, errors or otherwise). – Roland Aug 07 '19 at 07:56
  • Btw. , the newest version of pkgbuild is not yet available as a binary. You might need to tell R to install the older binary if you use windows and don't have Rtools installed (usually it should ask). – Roland Aug 07 '19 at 08:02
  • Updating packages works; removing blavaan does not: Error in find.package(pkgs, lib) : there is no package called ‘blavaan’ – Mar-05 Aug 07 '19 at 08:05
  • OK, no problem. Just install it. – Roland Aug 07 '19 at 08:06
  • I indeed use windows and do not have Rtools installed. Then how can i install the older binary of pkgbuild? – Mar-05 Aug 07 '19 at 08:09
  • What happens if you do `install.packages("pkgbuild")`? – Roland Aug 07 '19 at 08:10
  • R tells me there is a binary version available with a later source version, thus the source is installed. Next pkgbuild is successfully unpakced and MD5 sums checked (thus all is normal). However, when preparing for lazy loading: Error in findpack(package, lib.loc) : there is no package called 'pkgbuild' Calls: -> findpack Execution halted ERROR: lazy loading failed for package 'pkgbuild' * removing And then warning that pkgbuild has non-zero exit status – Mar-05 Aug 07 '19 at 08:15
  • Try `options(install.packages.check.source = "no"); install.packages("pkgbuild", type = "binary")`. – Roland Aug 07 '19 at 08:17

0 Answers0