Re: [R] generating a bar chart with two axis for co-linear variable

2013-06-07 Thread Sudha Krishnan
Arun, Perfect, this is what I was looking for. Thanks, Sudha Krishnan -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: Friday, June 07, 2013 2:36 AM To: Sudha Krishnan Cc: R help Subject: Re: [R] generating a bar chart with two axis for co-linear variable HI, Not

Re: [R] generating a bar chart with two axis for co-linear variable

2013-06-06 Thread John Kane
I think we really need to see the code. John Kane Kingston ON Canada -Original Message- From: sudha.krish...@marlabs.com Sent: Thu, 6 Jun 2013 06:37:41 + To: r-help@r-project.org Subject: [R] generating a bar chart with two axis for co-linear variable Hello Dimitris,

Re: [R] generating a bar chart with two axis for co-linear variable

2013-06-06 Thread arun
HI, May be this helps: dat1- read.table(sampledata.txt,header=TRUE,sep=,,stringsAsFactors=FALSE) pdf(Barplots.pdf)  lst1-lapply(seq_len(ncol(dat1)),function(i) {Ctdat- table(dat1[,i]);Ctdat1-(Ctdat/sum(Ctdat))*100;barplot(Ctdat1,ylim=c(0,100),xlab=colnames(dat1)[i],ylab=Relative

Re: [R] generating a bar chart with two axis for co-linear variable

2013-06-06 Thread arun
HI, Not sure if this is what you wanted. pdf(BarplotsNew.pdf) library(plotrix) lst2-lapply(seq_len(ncol(dat1)),function(i){                     Ctdat- table(dat1[,i])                     Ctdat1-(Ctdat/sum(Ctdat))*100                     dat2-data.frame(Ctdat,Ctdat1,stringsAsFactors=FALSE)[,-3]