Re: [R] merge dataframes with condition

2012-11-16 Thread Geophagus
Hi @ all, thanks for the solutions! Now I can go on. Greetz GeoPhagUS -- View this message in context: http://r.789695.n4.nabble.com/merge-dataframes-with-condition-tp4649605p4649712.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] merge dataframes with condition

2012-11-16 Thread Geophagus
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 barcha

Re: [R] merge dataframes with condition

2012-11-15 Thread jim holtman
Is this what you want: > animal<-c("bear","bear","lion","monkey","fish","monkey","bear","zebra","zebra") > val<-c(2,42,67,5,12,9,87,1,12) > place<-c("S","N","N","Z","R","O","E","I","Q") > df1<-data.frame(animal,val,place) > animal<-c("bear","bear","lion","monkey","fish","monkey","bear","zebra","ze