Displaying 2 results from an estimated 2 matches for "group_df".
2009 Nov 19
1
ddply function nesting problems
...??? min_range<-1
??????? max_range<-30
??????? bin_range_size<-5
??????? Me_df<-data.frame(Data = c(1:15), Person = "Me")
??????? You_df<-data.frame(Data = c(10:20), Person = "You")
??????? Them_df<-data.frame(Data = c(15:25), Person = "Them")
??????? Group_df_tmp<-rbind(Me_df,You_df)
??????? Group_df<-rbind(Group_df_tmp,Them_df)
??????? Group_df$Person <- factor(Group_df$Person, levels = c("Them", "You", "Me"))
??????? #counts <- ddply(Group_df, .(cut(Data, breaks=fullseq(range(Data), 5)), Person), nrow)
???????...
2009 Feb 05
1
A way to "lock down" the order of bars for ggplot "dodged" histogram
...rce the order of the variables in the bin. For example, say I have three variables Me, You, and Them.
Me_df<-data.frame(Data = c(1:15), Person = "Me")
You_df<-data.frame(Data = c(10:20), Person = "You")
Them_df<-data.frame(Data = c(15:25), Person = "Them")
Group_df_tmp<-rbind(Me_df,You_df)
Group_df<-rbind(Group_df_tmp,Them_df)
counts <- ddply(Group_df, .(cut(Data, breaks=fullseq(range(Data), 5)), Person), nrow)
names(counts) <- c("Bin", "Person", "Frequency")
qplot(Person, Frequency, data = counts, fill = Person, geo...