Jump to content

Spotfire Enterprise Runtime for R Returned Error


thansen
Go to solution Solved by Gaia Paolini,

Recommended Posts

Just installed Spotfire 14.4.0 and I am receiving the following error trying to execute a data function:

Spotfire Enterprise Runtime for R returned an error (3)

The data function 'RSProdAvg' could not be executed.

Error in .package.execute.initialization.function(ns, ".onLoad", dirn : error executing function '.onLoad' from package 'glue' loaded from C:/Users/tyler/DOCUME~1/TERR/X86_64~1/6.1 : Error in registerS3method(generic, class, fun, envir = asNamespace(pk... : object 'vec_ptype2' not found

Any help addressing would be appreciated.

 

 

Link to comment
Share on other sites

I found the following entry in one of our Support Tickets for the same error message:

Resolution:

It typically helps to load the "vctrs" package before each data function's TERR script loads the "dplyr" package (or any other CRAN package).

That is, use a sequence similar to the following commands at the very beginning of the script:

library(vctrs)
ibrary(dplyr)

Also: remove dplyr (and other CRAN packages) from the data function's "Packages (separated by semicolons):" field in the data function's "Edit Script" dialog. (Otherwise, the Spotfire data function framework will make calls like 'library(dplyr)' before it starts to run the data function's TERR script.) .

 

Background:

The namespace for the "vctrs" package hasn't finished loading before the hidden .onLoad() initialization functions for "dplyr", "glue" and/or "tibble" (and others) try to use objects that only exist in the "vctrs" namespace.

Calling library(vctrs) before calling library() for any other CRAN package helps to get the "vctrs" namespace fully loaded into the TERR session's working memory before the other packages need it.

 

Hopefully this will work for you.

Cheers
Dave

 

Link to comment
Share on other sites

Dave, thanks for the quick response. Updated my script to call library(vctrs) before library(dplyr), but now returning the error below. Any other ideas?

Spotfire Enterprise Runtime for R returned an error

The data function 'RSProdAvg' could not be executed.

Error in .package.execute.initialization.function(ns, ".onLoad", dirn : error executing function '.onLoad' from package 'glue' loaded from C:/Users/tyler/DOCUME~1/TERR/X86_64~1/6.1 : Error in registerS3method(generic, class, fun, envir = asNamespace(pk... : object 'vec_ptype2' not found
    eval(script, envir = .GlobalEnv)
    eval(script, envir = .GlobalEnv)
    withCallingHandlers({
    library(dplyr)
    .loadNamespace(package, lib.loc = lib.loc, keep.source = keep.source,
    .loadNamespaceImpl(package, path, keep.source, partial)
    .createImportEnv(nsinfo, package)
    loadNamespace(i)
    .loadNamespace(package, lib.loc, keep.source, partial, quietly,
    .loadNamespaceImpl(package, path, keep.source, partial)
    .package.execute.initialization.function(ns, ".onLoad", dirname(path),
    stop(paste("error executing function '", fn.name, "' from package '",

 

Here's what my script looks like. I removed dplyr from the "Packages (seperated by semicolons):" input field.

image.png.dd036efa3434bf6394eae3238d384649.png

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...