Re: [R] How to select a subset data to do a barplot in ggplot2

2012-12-13 Thread Dennis Murphy
Hi: The simplest way to do it is to modify the input data frame by taking out the records not having status live or dead and then redefining the factor in the new data frame to get rid of the removed levels. Calling your input data frame DF rather than data, DF <- structure(list(FID = c(1L, 1L, 2

Re: [R] How to select a subset data to do a barplot in ggplot2

2012-12-13 Thread arun
Hi, May be this: p<-ggplot(subset(dat1,STATUS!="nosperm"),aes(x=FID))  p+geom_bar(aes(x=factor(FID),y=..count..,fill=STATUS)) A.K. - Original Message - From: Yao He To: r-help@r-project.org Cc: Sent: Thursday, December 13, 2012 7:38 AM Subject: [R] How to select a subs

[R] How to select a subset data to do a barplot in ggplot2

2012-12-13 Thread Yao He
Hi,everybody I have a dataframe like this FID IID STATUS 14621live 14628dead 24631live 24632live 24633live 24634live 64675live 64679dead 104716dead 104719live 104721dead 114726live 114728nosper