search for: position_jitt

Displaying 9 results from an estimated 9 matches for "position_jitt".

Did you mean: position_jitter
2009 Sep 12
1
ggplot2: deterministic position_jitter & geom_line with position_jitter
Dear guRus, I am starting to work with the ggplot2 package and have two very dumb questions: 1) deterministic position_jitter - the jittering is stochastic; is there any way to get a deterministic jittering? For instance: example.data <- data.frame(group=c("foo","bar","foo","bar","foo","bar"),x=c(1,1,2,2,3,3),y=c(1,1,0,2,1,1)) set.seed(2009) qplot(x,y,dat...
2013 Mar 08
2
ggplot2: modifying line width and background fill color for stat_smooth()
...ersion of the same color used for the separate fitted lines for GENDER, rather than grey for both. How can I do this? donner<-read.csv("http://www.ling.upenn.edu/~joseff/data/donner.csv") ggplot(donner, aes(AGE, NFATE, color = GENDER))+ geom_point(position = position_jitter(height = 0.02, width = 0)) + stat_smooth(method = "glm", family = binomial, formula = y ~ poly(x,2)) For the line width, I tried, ggplot(donner, aes(AGE, NFATE, color = GENDER))+ geom_point(position = position_jitter(height = 0.02, width = 0)) + stat_smooth(aes(size=2), metho...
2011 Oct 21
1
lattice::xyplot/ggplot2: plotting weighted data frames with lmline and smooth
In the HistData package, I have a data frame, PearsonLee, containing observations on heights of parent and child, in weighted form: library(HistData) > str(PearsonLee) 'data.frame': 746 obs. of 6 variables: $ child : num 59.5 59.5 59.5 60.5 60.5 61.5 61.5 61.5 61.5 61.5 ... $ parent : num 62.5 63.5 64.5 62.5 66.5 59.5 60.5 62.5 63.5 64.5 ... $ frequency: num 0.5 0.5
2017 Nov 02
3
ggplot inside function doesn't plot
I have a function: myplot <- function (X) { d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) png(paste("img/", X, ".png", sep="")) ggplot(d, aes(x=condition, y=count, color=condition)) + geom_point(position=position_jitter(w=0.1,h=0)) + scale_y_log10(breaks=c(25,100,400)) + ggtitle(X) + theme(plot.title = element_text(hjust = 0.5)) dev.off() } 'd' is a dataframe count condition E11.5 F20HET BA40_quant 955.9788 E11.5 F20HET E11.5 F20HET...
2017 Nov 02
3
ggplot inside function doesn't plot
...;- function (X) { >> d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) >> png(paste("img/", X, ".png", sep="")) >> ggplot(d, aes(x=condition, y=count, color=condition)) + >> geom_point(position=position_jitter(w=0.1,h=0)) + >> scale_y_log10(breaks=c(25,100,400)) + >> ggtitle(X) + >> theme(plot.title = element_text(hjust = 0.5)) >> >> dev.off() >> } >> >> 'd' is a dataframe >> >> co...
2017 Nov 02
0
ggplot inside function doesn't plot
...> myplot <- function (X) { > d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) > png(paste("img/", X, ".png", sep="")) > ggplot(d, aes(x=condition, y=count, color=condition)) + > geom_point(position=position_jitter(w=0.1,h=0)) + > scale_y_log10(breaks=c(25,100,400)) + > ggtitle(X) + > theme(plot.title = element_text(hjust = 0.5)) > > dev.off() > } > > 'd' is a dataframe > > count condition > E11.5 F20HET...
2010 May 31
0
Put two plots side by side
Two different ways: library(ggplot2) x=5 size=50 A=data.frame(X=sample(x, size, replace=T), Y=sample(x, size, replace=T),a=rep(1:2,each=25));A # Facetting qplot(X,Y,data=A) + geom_jitter(position=position_jitter(width=.03)) + facet_grid(.~a) # Or with vp p=qplot(X, Y, data=A) + geom_jitter(position=position_jitter(width=.03)) ggsave(p, file='main.png') p1=qplot(X, Y, data=A) + geom_jitter(position=position_jitter(width=.3)) ggsave(p1, file='main2.png') vport <- function(x, y) viewport(...
2013 Dec 17
1
ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula
With ggplot2, I can plot the glm stat_smooth for binomial data when the response is binary or a two-level factor as follows: data("Donner", package="vcdExtra") ggplot(Donner, aes(age, survived)) + geom_point(position = position_jitter(height = 0.02, width = 0)) + stat_smooth(method = "glm", family = binomial, formula = y ~ x, alpha = 0.2, size=2) But how can I specify the formula for stat_smooth when the response is cbind(successes, failures)? The equivalent with plot (minus the confidence band) for the example I...
2013 Jan 14
1
Tukey HSD plot with lines indicating (non-)significance
...dered by group means, and it is only guaranteed to # work for balanced data. Example, with the lines missing: library(ggplot2) d=rice d$trt=reorder(d$trt, -d$ShootDryMass) ggplot(d, aes(x=trt, y=ShootDryMass)) + geom_boxplot(outlier.colour=NA) + geom_jitter(col="red", size=3, position=position_jitter(width=.1)) Is there such a function available in R? -- Karl Ove Hufthammer