Learn R Programming

rlist (version 0.4.6.1)

list.iter: Iterate a list by evaluating an expression on each list element

Description

Iterate a list by evaluating an expression on each list element

Usage

list.iter(.data, expr)

Arguments

.data

list

expr

A lambda expression

Value

invisible(.data)

Examples

Run this code
# NOT RUN {
x <- list(p1 = list(type='A',score=list(c1=10,c2=8)),
       p2 = list(type='B',score=list(c1=9,c2=9)),
       p3 = list(type='B',score=list(c1=9,c2=7)))
list.iter(x,cat(paste(type,'\n')))
list.iter(x,cat(str(.)))
# }

Run the code above in your browser using DataLab