Refering the discussed issue: As a result I have dataframe like the following.
animal<-c("bear","lion","monkey","fish","zebra") S<-c(10,20,40,5,12) N<-c(5,8,15,26,1) Z<-c(24,12,8,7,2) R<-c(21,14,2,5,3) Q<-c(13,9,9,16,1) df1<-data.frame(animal,S,N,Z,R,Q) Now, I want to plot it as a stacked barchart so that it looks like on the example below. examp3.png <http://r.789695.n4.nabble.com/file/n4649714/examp3.png> It's clear to me, that I have to transform the frame again - but I'm not quite sure how to do it. Thanks GeO -- View this message in context: http://r.789695.n4.nabble.com/merge-dataframes-with-condition-tp4649605p4649714.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.