Updating CRAN packages and manual building

21 views
Skip to first unread message

Patryk Ferenc

unread,
Feb 22, 2023, 1:28:29 PMFeb 22
to Renjin
Hi,

I would love to use anthro and anthroplus packages from Renjin. While I can find anthro (although an older build...) in your package database, I can not find anthroplus.

Is there a form or way to request it being built for Renjin? Or maybe there is a way (sorry but I could not really find ways to do it in the docs) to build the packages myself so I can at least use them locally.

Much love to you all for creating Renjin, I really hope someone can provide me with guidance here :))

Patryk

Patryk Ferenc

unread,
Feb 27, 2023, 1:39:28 PMFeb 27
to Renjin
So I managed to create a package using the cli (renjin package for those that didn't get the memo like I did...), however only anthro worked.

 I have two questions mainly:
  1.  During building of anthroplus I got an error that I think is related to using "load()" for RDS files. I read that it is connected to R using a different format since 3.5.0. I don't get if this is an error with the library or Renjin?
    Trace:
    [INFO]  Resolving dependencies...
    [INFO]  Resolving transitive dependencies...
    [INFO]  Downloading dependencies...
    [INFO]  Loading sysdata.rda
    java.io.IOException: Error evaluating sysdata.rda
            at org.renjin.packaging.NamespaceBuilder.loadPackageData(NamespaceBuilder.java:154)
            at org.renjin.packaging.NamespaceBuilder.compile(NamespaceBuilder.java:79)
            at org.renjin.packaging.PackageBuilder.compileNamespace(PackageBuilder.java:184)
            at org.renjin.packaging.PackageBuilder.build(PackageBuilder.java:61)
            at org.renjin.cli.build.Builder.buildPackage(Builder.java:60)
            at org.renjin.cli.build.PackageBuildCommand.tryRun(PackageBuildCommand.java:32)
            at org.renjin.cli.build.BuildCommand.run(BuildCommand.java:26)
            at org.renjin.cli.build.Builder.execute(Builder.java:54)
            at org.renjin.cli.Main.main(Main.java:51)
    Caused by: org.renjin.eval.EvalException: file 'sysdata.rda' has magic number 'RDX3'
       Use of save versions prior to 2 is unsupported
            at org.renjin.primitives.Conditions.stop(Conditions.java:250)
            at org.renjin.primitives.R$primitive$stop.doApply(R$primitive$stop.java:67)
            at org.renjin.primitives.R$primitive$stop.applyPromised(R$primitive$stop.java:32)
            at org.renjin.sexp.BuiltinFunction.apply(BuiltinFunction.java:100)
            at org.renjin.primitives.special.InternalFunction.apply(InternalFunction.java:46)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.primitives.special.IfFunction.apply(IfFunction.java:44)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:39)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.sexp.Closure.applyPromised(Closure.java:200)
            at org.renjin.sexp.Closure.apply(Closure.java:133)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:39)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.primitives.special.IfFunction.apply(IfFunction.java:40)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:39)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.primitives.special.IfFunction.apply(IfFunction.java:40)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.primitives.special.BeginFunction.apply(BeginFunction.java:39)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.sexp.Closure.applyPromised(Closure.java:200)
            at org.renjin.sexp.Closure.apply(Closure.java:133)
            at org.renjin.sexp.FunctionCall.eval(FunctionCall.java:80)
            at org.renjin.eval.Context.evaluate(Context.java:280)
            at org.renjin.packaging.NamespaceBuilder.loadPackageData(NamespaceBuilder.java:151)
            ... 8 more

  2. So for example if I include the package anthro from jar like this:

    dependencies {
    implementation "org.renjin:renjin-script-engine:3.5-beta76"
    // Alternatively, you can specify individual files as follows:
    implementation files('libs/anthro-1.0.0.jar')
    // implementation "org.renjin.cran:anthro:0.9.1-b1"
    implementation "org.renjin.cran:survey:3.36-b2"
    }

    I had to include survey (dependency of anthro), otherwise it wouldn't work, is this correct behaviour? The jar is not standalone and does not include the dependencies?
Thanks!
Patryk

Per Nyfelt

unread,
Mar 5, 2023, 8:44:19 AMMar 5
to renji...@googlegroups.com

Hi,

If you put your code in github or gitlab and send the link I'd be happy to take a look and compare with other libraries i have created or ported from GNU R. That being said here are some comments:

The first problem is true i.e. you cannot use RDS files from older versions than R3.5.0 in renjin 3.5 beta versions but why do you need to do that? Seems to me this should be fixed by resaving the sysdata.rda in 3.5 format.

The second problem sounds like a dependency management problem. Dependent jar are not included in the jar but the pom file will have the dependency correct so if you use a modern build system (gradle, maven or even ant with Ivy) this should not be an issue.

Regards,

Per

--
You received this message because you are subscribed to the Google Groups "Renjin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to renjin-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/renjin-dev/85b954be-d842-480c-a79d-3d5a80c5adb0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages