Displaying 1 result from an estimated 1 matches for "what_should_i_paste_here".
2002 Jul 11
1
How to get relevant dimnames from apply() ?
...row=5)
rownames(testarr)<-letters[1:5]
colnames(testarr)<-LETTERS[1:6]
apply(testarr,1,function(x) {x11(); barplot(x)}) #the funcion used is
actually more compex, but it doesn't matter
</R>
Now, how I can propagate the rownames of testarr into the main label of
plot via
main="what_should_I_paste_here?"
Asking for
<R>
str(apply(testarr,1,function(x) {x11(); barplot(x)}))
</R>
gives
<Routput>
num [1:6, 1:5] 0.7 1.9 3.1 4.3 5.5 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr [1:5] "a" "b" "c" "d" ...
</Rou...