« View all new features in
Mathematica
9
◄
previous

next
►
New in
Mathematica
9
›
Builtin Integration with R
Use Anonymous and HigherOrder R Functions
First, load and install the R runtime. Then define a higherorder filtering function in R and use it to filter a set of data.
In[1]:=
X
Needs["RLink`"] InstallR[]
In[2]:=
X
select = RFunction[" function(vec,test){ vec[test(vec)] }" ];
In[3]:=
X
select[Range[10], RFunction["function(x) { x > 5 }"]]
Out[3]=