Skip to content
Snippets Groups Projects
Commit 76159dbd authored by Lukas Stadler's avatar Lukas Stadler
Browse files

unpack RDataFrame in CallRFFIHelper.VECTOR_ELT

parent 9566e0a6
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ import com.oracle.truffle.r.runtime.data.RAttributes;
import com.oracle.truffle.r.runtime.data.RComplex;
import com.oracle.truffle.r.runtime.data.RComplexVector;
import com.oracle.truffle.r.runtime.data.RDataFactory;
import com.oracle.truffle.r.runtime.data.RDataFrame;
import com.oracle.truffle.r.runtime.data.RDoubleSequence;
import com.oracle.truffle.r.runtime.data.RDoubleVector;
import com.oracle.truffle.r.runtime.data.RExpression;
......@@ -485,7 +486,11 @@ public class CallRFFIHelper {
}
public static Object VECTOR_ELT(Object x, int i) {
RAbstractListVector list = guaranteeInstanceOf(RRuntime.asAbstractVector(x), RAbstractListVector.class);
Object vec = x;
if (vec instanceof RDataFrame) {
vec = ((RDataFrame) vec).getVector();
}
RAbstractListVector list = guaranteeInstanceOf(RRuntime.asAbstractVector(vec), RAbstractListVector.class);
return list.getDataAt(i);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment