You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggplot2 (ggplot2@googlegroups.com)
Hie
I am trying to plot a simple density plot from a table with four unequal columns but without success. I can plot the individual columns, but combining all four is proving to be a challenge.
This is what I have done:
> Trin_test<-read.table("triPE_trinPEs_Ab2_G2_length.txt", header=TRUE) > ggplot(Trin_test, aes(Trin_test$Trin_trans_length.bp, fill=Trin_test$Trin_trans_length.bp)) + geom_bar(width=0.1, colour="white")
stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this. > ggplot(Trin_test, aes(Trin_test$Trin_trans_length.bp, fill=Trin_test$Trin_trans_length.bp)) + geom_density(width=0.1, colour="white")
> ggplot(Trin_test, aes(Trin_test$Trin_trans_length.bp, fill=Trin_test$Trin_trans_length.bp)) + geom_density(width=0.1, colour="green") > assemb_test<-c("Trin_trans_length.bp.", "transcript_length.bp.", "Ab2_trans_length.bp.", "G2_trans_length.bp." )
> ggplot(Trin_test, aes(Trin_test$Trin_trans_length.bp, fill=assemb_test)) + geom_density(width=0.1, colour="green") Error: Aesthetics must either be length one, or the same length as the dataProblems:assemb_test
> ggplot(Trin_test, aes(Trin_test, fill=assemb_test)) + geom_density(width=0.1, colour="green") Error in data.frame(x = list(Trin_trans_length.bp. = c(1344L, 3049L, 626L, : arguments imply differing number of rows: 134422, 4
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggp...@googlegroups.com
Do a str() on the data.
As far as I can see you have one integer and 3 factors. If nothing else, I think that you have to convert all those * into NAs.
I have no idea of what will happen then, but currently it looks like you have an unuseable data.frame.
BTW you don't need ggplot(Trin_test, aes(Trin_test$Trin_trans_length.bp, fill=Trin_test$Trin_trans_length.bp))
ggplot(Trin_test, aes(Trin_trans_length.bp, fill=Trin_trans_length.bp)) is fine and for a reader renaming the dataset: something like names(mydata) <- c( "t1", "t2", "a1", "g1") would give ggplot(Trin_test, aes(t1, fill=t1))