In Renjin, what is the actual value returned by :
engine.eval("...")
For example:
df <- data.frame( 1 )
df[["X1"] <- df[["X1"]] * 10
returns a DoubleArrayVector with the single 10 value. I guess this is the last computation.
df <- data.frame( 1 )
df[["X1"] <- df[["X1"]] * 10
print(df)
returns a data.frame (ListVector...)
Is there any way to make the eval returns the data.frame df in the example above ?
Thx.
Renjin applies the all the normal rules of R evaluation, and a sequence of expressions will indeed evaluate to the value of the last expression.
If you want the value of
df
, then you can write in Java:Or:
In R, a data.frame is simply a
list
of columns of class "data.frame". You can see this by running the following in either GNU R or Renjin:From Java, you can access these columns using the ListVector's methods: