Dear all,


# 1. I use tapply to calculate various things based on a grouping variable.

# simple example using the warpbreaks dataset:
tmp <- with(warpbreaks, tapply(breaks, tension, range))
tmp
dimnames(tmp)

# 2. I wish to plot the result of each element of tmp, using the names of the elements in tmp as 'main' in each plot

# My attempt:
# par(mfrow = c(3, 1)) # my preferred 'par' in this case.
lapply(tmp, function(x) plot(x, main = dimnames(x)))




Apparently not the right way to extract dimnames to main. Any suggestion of how to proceed?

Thanks in advance for any comments.

Henrik


--
Henrik Pärn
Centre for Conservation Biology
Department of Biology
Norwegian University of Science and Technology
No-7491 Trondheim
NORWAY

Office: +47 735 96084
Mobile: +47 909 89 255
Fax: +47 735 96100

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to