[R] Re: follow up on "pairewise plots"

Hai Lin kevinvol2002 at yahoo.com
Tue Mar 29 20:10:30 CEST 2005


--- Dimitris Rizopoulos
<dimitris.rizopoulos at med.kuleuven.ac.be> wrote:
> you could try something like this:
> 
> dat <- array(sample(24), dim=c(4,2,3))
> par(mfrow=c(3,1))
> apply(dat, 3, function(x) plot(rowSums(x),
> x[,2]-x[,1]))

##

Thank you all for the inputs. It's great of help. 

The above solution also opens my mind that I could
convert my data to an array. 

dat <- data.frame(matrix(sample(24), nrow=4))
dimnames(dat) <-list(rownames=c('g1','g2','g3','g4'),
colnames=c("A_CH1","A_CH2","B_CH1","B_CH2","C_CH1","C_CH2"))

Sorry for the typo. (C_CH1, C_CH2)

dat2 <- array(unlist(dat), dim=c(4,2,3))  
and then plot them using Dimitris' solution.

Other statements of converting form are welcomed...

Thanks again.




More information about the R-help mailing list