[R] Help with stripplot

From: Ghosh, Sandeep <sghosh_at_lexgen.com>
Date: Wed 29 Jun 2005 - 07:28:15 EST


For the following code is there a way to make the jitter all line up horizontally, instead of them being just randomly spread around a value. So for ex if there are multiple values at 63 for genotype wt then all the values should be plotted on the same y value of 63 but spaced apart by a certain factor or noise..

library(lattice);

dataFrame <- as.data.frame(t(structure(c(

64,'wt',
62,'wt',
66,'wt',
65,'wt',
60,'wt',
61,'wt',
65,'wt',
66,'wt',
65,'wt',
63,'wt',
67,'wt',
65,'wt',
62,'wt',
65,'wt',
68,'wt',
65,'wt',
63,'wt',
65,'wt',
62,'wt',
65,'wt',
66,'wt',
62,'wt',
65,'wt',
65,'wt',
66,'wt',
65,'wt',
62,'wt',
65,'wt',
66,'wt',
65,'wt',
61,'wt',
65,'wt',
66,'wt',
65,'wt',
62,'wt',
63,'het',
67,'het',
60,'het',
67,'het',
66,'het',
62,'het',
65,'het',
62,'het',
61,'het',
62,'het',
66,'het',
60,'het',
65,'het',
65,'het',
61,'het',
64,'het',
68,'het',
64,'het',
63,'het',
62,'het',
64,'het',
62,'het',
64,'het',
65,'het',
60,'het',
65,'het',
70,'het',
63,'het',
67,'het',
66,'het',
65,'hom',
62,'hom',
68,'hom',
67,'hom',
67,'hom',
63,'hom',
67,'hom',
66,'hom',
63,'hom',
72,'hom',
62,'hom',
61,'hom',
66,'hom',
64,'hom',
60,'hom',
61,'hom',
66,'hom',
66,'hom',
66,'hom',
62,'hom',
70,'hom',
65,'hom',
64,'hom',
63,'hom',
65,'hom',
69,'hom',
61,'hom',
66,'hom',
65,'hom',
61,'hom',
63,'hom',
64,'hom',
67,'hom'), .Dim=c(2,98))));

colnames(dataFrame) <- c('marbles_buried', 'genotype');

dataFrame[c("marbles_buried")] <- lapply(dataFrame[c("marbles_buried")], function(x) as.numeric(levels(x)[x]));

trellis.par.set(theme = col.whitebg());

stripplot(jitter(marbles_buried) ~ genotype, data = dataFrame, aspect = 1, jitter = TRUE, xlab='Genotype', ylab = "Marbles Buried", main='MBA WTs Vs HOMs');

Thanks,
Sandeep Kumar Ghosh
Lexicon Genetics, Inc.,
8800 Technology Forest,
The Woodlands, TX 77380
(281) 863-3479
Internal Extension - 3479

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jun 29 07:38:31 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:06 EST