Basic Examples

Take two numbers larger than the specified value in a list:
In[]:=
list={1,3,5,4}
Out[]=
{1,3,5,4}
In[]:=
[◼]
TakeLarger
[list,3,2]
Out[]=
{4,5}
Do the same using the operator form of
TakeLarger
:
In[]:=
list//
[◼]
TakeLarger
[3,2]
Out[]=
{4,5}
In[]:=
[◼]
TakeLarger
[3,2]@list
Out[]=
{4,5}
Take the two values larger than the specified threshold in an association:
In[]:=
[◼]
TakeLarger
[<|a1,b2,c3,d5,e4|>,3,2]
Out[]=
e4,d5
Take 4 numbers larger than the specified value, or as many as are available:
In[]:=
[◼]
TakeLarger
[{1,7,4},3,UpTo[4]]
Out[]=
{4,7}
All numbers larger than a threshold:
In[]:=
[◼]
TakeLarger
[{1,7,4,5},3,UpTo[Infinity]]
Out[]=
{4,5,7}
Take two values in a list of
Quantity
objects:
In[]:=
[◼]
TakeLarger

1
kg
,
2
kg
,
3
kg
,
1
kg
,2
Out[]=

2
kg
,
3
kg


Scope

Get the two smallest elements that are larger than 3 in a list:
In[]:=
[◼]
TakeLarger
[{
π

,7π,

π
,23},3,2]
Out[]=
{7π,

π
}
Get the positions of the two smallest elements larger than 3:
In[]:=
list={
π

,7π,

π
,23};
In[]:=
[◼]
TakeLarger
[list"Index",3,2]
Out[]=
{2,3}
Get the elements along with their positions:
In[]:=
[◼]
TakeLarger
[list{"Element","Index"},3,2]
Out[]=
{{7π,2},{

π
,3}}
Let positions come first in the result:
In[]:=
[◼]
TakeLarger
[list{"Index","Element"},3,2]
Out[]=
{{2,7π},{3,

π
}}
Get associations containing the element and the position:
In[]:=
[◼]
TakeLarger
[listAll,3,2]
Out[]=
{Element7π,Index2,Element

π
,Index3}
Get the two smallest planets with radii larger than the Earth’s:
In[]:=
[◼]
TakeLarger
[EntityValue["Planet","Radius","EntityAssociation"],Entity["Planet","Earth"]["Radius"],2]
Out[]=

Neptune

24622.
km
,
Uranus

25362.
km
