[R] colour of label points on a boxplot

alison waller alison.waller at embl.de
Thu Aug 5 13:36:05 CEST 2010


Hi all,

I have 6 datasets(dataframes Assem_ContigsLen7 through all_ContigsLen12)
containing 3 columns (contig_id, contig_length, read_count).

Each dataset is composed of 3 types of contigs (assemblies of genomic
fragments), 1- all Bacterial fragments, 2 - all Viral fragments, 3 -
mixed fragments.

I identified the type of contig through a merge with another table with
just contig_id and contig_type as below:

AssemViral_ContigsLen<-merge(Assem_ContigsLen,allViral_contigs,by.x="contig_id",by.y="X.Contid.ID",all.x=FALSE)
 
Below is a boxplot for

boxplot(Assem_ContigsLen7$length,Assem_ContigsLen8$length,Assem_ContigsLen9$length,Assem_ContigsLen10$length,Assem_ContigsLen11$length,Assem_ContigsLen12$length,main="100species_rep2",ylab="Contig_length")


All of the longer contigs in the sixth data set are allViral.

How can I colour or label these?
I tried overlaying 2 boxplots of different colours (using add=TRUE), but
the individual points of the whiskers aren't coloured (and I can't
figure out how to do so)
I experimented with using points, but there isn't a general function
that I can apply to all 6 datasets to identify the allViral contigs.

specific questions;
1 -how can I color the data points that represent the whiskers in a boxplot?
2 - Can I identify and colour subsets of datapoints within a boxplot?
3- any other suggestions?

Thank you,

Alison





More information about the R-help mailing list