« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Built-in Integration with R
Use Anonymous and Higher-Order R Functions
First, load and install the R runtime. Then define a higher-order 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]=