Dear members,
I have numerous arrays that are organised in a list.
For example, suppose I have 2 arrays in a list called
alist
alist <- list(array(rpois(12,5), 6:8)
, array(rpois(15,5), 10:12))
with array dimnames
dimnames(alist[[1]]) <- list(LETTERS[1:6],
paste("namesd", 1:7, sep=""), paste("namese", 1:8,
sep=""))
dimnames(alist[[2]]) <- list(LETTERS[7:16],
paste("namesf", 1:11, sep=""), paste("namesg", 1:12,
sep=""))
My first question is: is it possible to name the
arrays themselves, e.g. if I try
names(alist) <- list("Array 1", "Array 2")
I get "\" and \"" at the beginning and end of each
name, i.e.
[1] "\"Array 1\"" "\"Array 2\""
Secondly, I would like to use the lapply function to
produce a report with:
____________________________________________________
Array 1
Dimension name: namese1
Row Value Value-Average(excluding Value)
A alist[[1]][1,1,1]
alist[[1]][1,1,1]-mean(alist[[1]][1,-1,1])
...etc for all elements in the first row on the array
B alist[[1]][2,1,1]
alist[[1]][2,1,1]-mean(alist[[1]][2,-1,1])
...etc
Dimension name: namese2
....
Dimension name: namese8
A...
Array 2
Dimension name: namesg1
...
Dimension name: namesg12
...
______________________
Can I use the apply to do this, something like
lapply(alist, function(k), apply(k, c(1,3), ...
but how do I layout the report using the array names,
dimension names etc and with each observation on a
separate line? Is this possible?
Thanks for any help in advance.
Dave
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news