Displaying 2 results from an estimated 2 matches for "a_df".
Did you mean:
a_d
2012 Feb 22
1
Lattice and horizontally stacked density plots
...sed on
the value of id1. ?Note that the code example works fine if I use
"boxplot" instead of "densityplot". Any pointers would be much
appreciated.
library(lattice)
val<-rep(rnorm(10),100)
id1<-sample(c(1:5), 100, replace = TRUE)
id2<-rep(c(6:10),100, replace = TRUE)
a_df<-data.frame(cbind(id1, id2, val))
densityplot(factor(id1) ~ val | factor(id2), data=a_df)
-Manish
2011 Apr 25
1
average among one factor in a nested dataframe
I have two nested data frames:
a<-rnorm(6)
b<-rnorm(9)
f1<-c("x1","x2","x3"))
f2<-c("y1","y2")
id<-c(1:6)
a_df<-data.frame(cbind(id,f1,"y1",a))
id<-c(1:9)
b_df<-data.frame(cbind(id,f1,"y2",b))
I want to preserve id and f1, but want to collapse f2 and take the
corresponding mean values of a and b. Missing value in either dataframe
should be handled properly (i.e., just take the...