Macaulay2 » Documentation
Packages » RInterface :: iterator(RObject)
next | previous | forward | backward | up | index | toc

iterator(RObject) -- iterate through an R object

Synopsis

Description

This returns an Iterator object that may be used to iterate through x.

i1 : i = iterator (RSymbol "iris")_"Petal.Length"

o1 = iterator/  [1] 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 1.5 1.6 1.4 1.1 1.2 1.5 1.3 1.4\
             | [19] 1.7 1.5 1.7 1.5 1.0 1.7 1.9 1.6 1.6 1.5 1.4 1.6 1.6 1.5 1.5 1.4 1.5 1.2|
             | [37] 1.3 1.4 1.3 1.5 1.3 1.3 1.3 1.6 1.9 1.4 1.6 1.4 1.5 1.4 4.7 4.5 4.9 4.0|
             | [55] 4.6 4.5 4.7 3.3 4.6 3.9 3.5 4.2 4.0 4.7 3.6 4.4 4.5 4.1 4.5 3.9 4.8 4.0|
             | [73] 4.9 4.7 4.3 4.4 4.8 5.0 4.5 3.5 3.8 3.7 3.9 5.1 4.5 4.5 4.7 4.4 4.1 4.0|
             | [91] 4.4 4.6 4.0 3.3 4.2 4.2 4.2 4.3 3.0 4.1 6.0 5.1 5.9 5.6 5.8 6.6 4.5 6.3|
             |[109] 5.8 6.1 5.1 5.3 5.5 5.0 5.1 5.3 5.5 6.7 6.9 5.0 5.7 4.9 6.7 4.9 5.7 6.0|
             |[127] 4.8 4.9 5.6 5.8 6.1 6.4 5.6 5.1 5.6 6.1 5.6 5.5 4.8 5.4 5.6 5.1 5.1 5.9|
             \[145] 5.7 5.2 5.0 5.2 5.4 5.1                                                /

o1 : Iterator
i2 : next i

o2 = [1] 1.4

o2 : RObject of type double
i3 : next i

o3 = [1] 1.4

o3 : RObject of type double
i4 : next i

o4 = [1] 1.3

o4 : RObject of type double

Ways to use this method: