3

I have the following Renjin Java Code, the code assigns data from Java into Renjin (2 double arrays), creates a new data frame, prints in and saves it as Rdata, as following:

 engine.put("adId", adId);
 engine.put("LandscapeCurrent", LandscapeCurrent);
 engine.eval("df=data.frame(ad_id=adId,LandscapeCurrent=LandscapeCurrent)");
 engine.eval("print(df)");
 engine.eval("save(df,file='C:/Users/yschellekens.INTRANET/Desktop/Stack overflow/output.Rdata')");

df の標準出力 ( 内NetBeans):

  ad_id            LandscapeCurrent
  1 20383789401      244770561       
  2 20763458001      237478641       
  3 19807565841      231586281       
  4 20320895121      243414801       
  5 20923711401      251952681
  ... 

Java コードを実行した後、データ (df) を R にロードすると、null データ フレームが取得されます。

load('C:/Users/yschellekens.INTRANET/Desktop/Stack overflow/output.Rdata')
> dput(df)
structure(list(ad_id = numeric(0), LandscapeCurrent = numeric(0)), class = "data.frame", .Names = c("ad_id", 
"LandscapeCurrent"), row.names = integer(0))
4

0 に答える 0