Variable names in Jamovi R vs. System R?

Everything related to the development of modules in jamovi

by jonathon » Fri Mar 13, 2020 1:51 am

hmm, you're right, this is freaking ridiculous.

so i've forked RSA, stripped out all references to tcltk, tkrplot, and committed it here:

https://github.com/jonathon-love/RSA

next i've cloned your project, and tweaked the imports as follows:

Imports: jmvcore (>= 0.8.5), R6, formula.tools, lavaan, aplpack
Remotes: jonathon-love/RSA

and still i get:

```
* installing *source* package ‘RSA’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Warning: S3 methods ‘as.character.tclObj’, ‘as.character.tclVar’, ‘as.double.tclObj’, ‘as.integer.tclObj’, ‘as.logical.tclObj’, ‘as.raw.tclObj’, ‘print.tclObj’, ‘[[.tclArray’, ‘[[<-.tclArray’, ‘$.tclArray’, ‘$<-.tclArray’, ‘names.tclArray’, ‘names<-.tclArray’, ‘length.tclArray’, ‘length<-.tclArray’, ‘tclObj.tclVar’, ‘tclObj<-.tclVar’, ‘tclvalue.default’, ‘tclvalue.tclObj’, ‘tclvalue.tclVar’, ‘tclvalue<-.default’, ‘tclvalue<-.tclVar’, ‘close.tkProgressBar’ were declared in NAMESPACE but not found
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Tcl/Tk support is not available on this system
Execution halted
ERROR: lazy loading failed for package ‘RSA’
* removing ‘/Users/jonathon/Documents/GitHub/rsaj/build/R3.6.1-macos/RSA’
Error: Failed to install 'RSA' from GitHub:
(converted from warning) installation of package ‘/var/folders/k2/zv10wscj78b3q6q2qjyhy3b40000gn/T//RtmpTQqHhL/file3d9dff64fdb/RSA_0.9.13.tar.gz’ had non-zero exit status
Execution halted

Failed to install remotes
```

and i'm like, wtf! *NONE* of these things are defined in the NAMESPACE. this is really weird.

jonathon
User avatar
jonathon
 
Posts: 1379
Joined: Fri Jan 27, 2017 10:04 am

by jonathon » Fri Mar 13, 2020 1:52 am

unless one of these other dependencies references tcltk?

jonathon
User avatar
jonathon
 
Posts: 1379
Joined: Fri Jan 27, 2017 10:04 am

by Mindspace » Fri Mar 13, 2020 3:40 pm

Thanks for looking into this!

Yes, it looks like aplpack (https://github.com/cran/aplpack) also imports tcltk, although removing the references to it in the description and namespace files in the build folder doesn't seem to help. Do all references in the aplpack code itself also have to be removed to prevent tcltk loading, or should changes to the description/namespace files be sufficient?
Mindspace
 
Posts: 10
Joined: Tue Mar 03, 2020 7:31 pm

by Mindspace » Fri Mar 13, 2020 9:00 pm

Hmm... so I cloned your forked copy of RSA so that I could remove the aplpack imports (had to setup a github account because it looks like jmvtools::install doesn't support remotes on gitlab?): https://github.com/MindSpace20/RSA

The RSAj DESCRIPTION file was modified as such:

Code: Select all
Imports: jmvcore (>= 0.8.5), R6, formula.tools, lavaan
Remotes: MindSpace20/RSA


When I try installing it, however, this is the result:

Installing remotes
MindSpace20/RSA
Downloading GitHub repo MindSpace20/RSA@master
v checking for file 'C:\Users\MindSpace\AppData\Local\Temp\Rtmpkre5Oe\remotes25b0533d593\MindSpace20-RSA-2d28cc9/DESCRIPTION' ...
- preparing 'RSA':
v checking DESCRIPTION meta-information ...
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'
Warning in as.POSIXlt.POSIXct(x, tz) : unknown timezone 'GMT'
Warning in as.POSIXlt.POSIXct(x, tz) :
unknown timezone 'America/New_York'
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- looking to see if a 'data/datalist' file should be added
- building 'RSA_0.9.13.tar.gz'

Error in strptime(xx, f, tz = tz) :
(converted from warning) unknown timezone 'America/New_York'
Error: Failed to install 'RSA' from GitHub:
(converted from warning) installation of package 'C:/Users/Jacob/AppData/Local/Temp/Rtmpkre5Oe/file25b020532f1d/RSA_0.9.13.tar.gz' had non-zero exit status
Execution halted

Failed to install remotes


Where is the timezone information coming from? Is that really what's halting the install?
Mindspace
 
Posts: 10
Joined: Tue Mar 03, 2020 7:31 pm

by jonathon » Fri Mar 13, 2020 11:26 pm

(had to setup a github account because it looks like jmvtools::install doesn't support remotes on gitlab?)


yeah, i really think supporting gh alternatives is important too :/ ... just a bit squashed for time means i cut corners.

Where is the timezone information coming from? Is that really what's halting the install?


yup, if you look closely, it's converting a warning to an error (i don't know why remotes does this):

Code: Select all
Error in strptime(xx, f, tz = tz) :
(converted from warning) unknown timezone 'America/New_York'


if you set the R_REMOTES_NO_ERRORS_FROM_WARNINGS environmental variable, you'll be in business (i've been meaning to automatically set this in jmvtools).

cheers

jonathon
User avatar
jonathon
 
Posts: 1379
Joined: Fri Jan 27, 2017 10:04 am

by Mindspace » Sun Mar 15, 2020 2:21 am

Perfect, that did the trick. The module now works without the tcl support files.

Thanks for your help!
Mindspace
 
Posts: 10
Joined: Tue Mar 03, 2020 7:31 pm

by jonathon » Sun Mar 15, 2020 2:48 am

great to hear! thanks for persevering.

cheers

jonathon
User avatar
jonathon
 
Posts: 1379
Joined: Fri Jan 27, 2017 10:04 am

by jonathon » Sun Mar 15, 2020 2:49 am

if you get stuck in future, drop us a line at contact <at> jamovi.org, and i can send you a slack invite. that can be an easier way to discuss things.

cheers
User avatar
jonathon
 
Posts: 1379
Joined: Fri Jan 27, 2017 10:04 am

Previous

Return to Module development