# NOT RUN {
# sum up 1:i for i in 1:5
gen.named.list("sum_to_{x}", sum(1:x), x = 1:5)
# matrix with named columns and rows
gen.named.matrix("row{i}", gen.named.vector("col{j}", i+j, j = 1:3), i = 1:3)
# a matrix where the expression refers to the rows and not the columns
gen.named.matrix("col{i}", c(row1 = i, row2 = 10 * i, row3 = 100 * i), i = 1:10,
byrow = TRUE)
# }
Run the code above in your browser using DataLab