Hello,
I wrote a code in R that I want to run into JMP. Here is the code :
R init();
//send data to R
R Send(dt);
R submit("
library(spatstat)
#creation fenetre
fenn<-owin(xrange=c(40,760), yrange=c(40,160), poly=NULL, mask=NULL, units=NULL)
ppp<-ppp(x=dt$XM,y=dt$YM,window=fenn)
print(quadratcount(ppp,nx=6,ny=3)
Q<-quadrat.test.ppp(ppp,nx=6,ny=3)
a<-cdf.test(ppp,'x')
D=0
if(a[[2]] & Q[[3]] < 0.1 ){
D=0}else {D=1}
Distribution=as.data.frame(rep(c(D),nrow(dt)))
class(Distribution)
print(a)
");
R term();
Then when I run it I got two issues:
Firstly I have an error from these lines :
fenn<-owin(xrange=c(40,760), yrange=c(40,160), poly=NULL, mask=NULL, units=NULL)
ppp<-ppp(x=dt$XM,y=dt$YM,window=fenn)
which says :
Error: Function boundingbox called with 2 unrecognised arguments
In addition: Warning message:
2 points were rejected as lying outside the specified window
In fact when I change 40 into 0 it works because all my points are in my window, but when I run the code on R the fact that all my points are not in the window is not an issue. And if I run the previous code in R it works. So I don't understand why I got a warning message in JMP but not in R.
The second issue is when I want to export my data, JMP don't want to extract my data frame and I don't understand why. I use this code :
ResidJMP = R Get(Distribution);
ResidJMP << New Data View;
R term();
In fact I want to return a data table in JMP and after I want to use it as the main data table.