R Get() function returns errorI am having problem getting a data frame from R to JMP.
This little simple test works fine and returns "1" as it should
clear symbols();
R Init();
R submit("
x <- 1
");
a = R Get(x);
R Term();
a
A longer R code looking something like this
clear symbols();
R Init( );
R submit("\[
library(dplyr)
.. 20 lines of code ..
head(X) // Output of "head(X)" gives the expected first five rows of X, good
]\");
R Get(X) << NewDataView;
Returns the following error:
"Warning: Error in readBin(fc, "integer", n = SRBX_FILEHEADER_LENGTH) :
Warning: object 'SRBX_FILEHEADER_LENGTH' not found
Unknown"
Any clues?
Re: R Get() function returns errorThanks for the advice. It made me go through the code again.
The error message somehow disappear if I put "R Term()" at the start of of the script. I think the error came because previous R connections had not been terminated
Re: R Get() function returns errorWhile I am not familiar with that particular error I sometimes see strange things when exporting tibble columns as you are probably doing using dplyr. You might be able to narrow down the issue by subsetting columns (and/or using slice() to subset rows) and exporting smaller tables.
Names default to here( 1 );
R Init( );
R submit("\[
library(dplyr)
data(mtcars)
df = mtcars %>% add_rownames
]\");
R submit("dfout = select(df, 1:3)");
R Get(dfout) << NewDataView;
R submit("dfout = select(df, 4:6)");
R Get(dfout) << NewDataView;
R Term();