viewtopic.php?f=11&t=2132
My code:
Code: Select all
X <- self$data[,self$options$var_x,drop=FALSE]
Y <- self$data[,self$options$var_y,drop=FALSE]
if(self$options$std==TRUE){
X <- scale(X)
Y <- scale(Y)
}
formula <- jmvcore::constructFormula('Y','X')
formula <- as.formula(formula)
p <- pls::mvr(formula,
ncomp = self$options$ncomp,
scale = self$options$std,
method = self$options$method,
validation = self$options$val)
I have add Add 'pls' package in import field such as:
Code: Select all
Imports:
jmvcore (>= 0.8.5),
pls,
R6
- if there's only default export function, the module build successfully. but in JAMOVI, it shows error message:
there is no package called 'pls'
- if add "import(pls)" or "importFrom(pls,mvr)", then the package(also called module) building fail.the log is:
jamovi compiler
jamovi 2.3.17 found at C:\Program Files\jamovi 2.3.17.0\bin\jamovi.exe
wrote: pls.h.R
wrote: pls.u.yaml
wrote: pls.src.js
(node:2752) [DEP0128] DeprecationWarning: Invalid 'main' field in 'E:\ProgramFiles\R\R-4.2.1\library\jmvtools\node_modules\jamovi-compiler\node_modules\po2json\package.json' of './lib/po2json'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
wrote: pls.js
writing module meta
wrote: 0000.yaml
wrote: jamovi.yaml
wrote: jamovi-full.yaml
Installing dependencies
pls
trying URL 'https://cran.microsoft.com/snapshot/202 ... _2.8-0.zip'
Content type 'application/zip' length 1271334 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
package 'pls' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Administrator\AppData\Local\Temp\RtmpeOsnWd\downloaded_packages
* installing *source* package 'PLS' ...
** using staged installation
Warning in as.POSIXlt.POSIXct(x, tz) : unknown timezone 'Asia/Taipei'
Warning in as.POSIXlt.POSIXct(x, tz) : unknown timezone 'GMT'
Warning in as.POSIXlt.POSIXct(x, tz) :
unknown timezone 'America/New_York'
Warning in as.POSIXlt.POSIXct(x, tz) : unknown timezone 'GMT'
Warning in as.POSIXlt.POSIXct(x, tz) :
unknown timezone 'America/New_York'
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[]) :
there is no package called 'pls'
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package 'PLS'
* removing 'F:/PLS/build/R4.1.2-win64/PLS'
* restoring previous 'F:/PLS/build/R4.1.2-win64/PLS'
Could not build module
Thanks a lot for your help.