Displaying 20 results from an estimated 4000 matches similar to: "ggplot multiple scales but a stat for only one of them"
2014 Nov 20
2
ggplot question error: Error in s(x, bs = "cs") : object 'x' not found
Dear R-ers,
apologies for not providing the full code. I just need a point in the
right direction.
I have a data frame ('temp') with 1,200 rows and 2 variables.
I am using ggplot2 to create a scatter plot:
This is my code and it works fine, it creates a scatter plot:
library(ggplot2)
sp10<-ggplot(temp,aes(x=p.used_L1,y=l.to.r.ratio_L1))
sp10 + geom_point()
However, when I change the
2012 Sep 26
1
Interaction scatterplots in ggplot with multiple regression lines
I'm trying to treat a continuous variable as discrete for plotting
multiple regression lines in a scatterplot as a function of the level
on the moderating variable. In the example below, there is only one
regression line plotted to the whole data. I would like a separate
regression line for each discrete level of the moderator. The
moderator is continuous, so I'd like to treat it as
2013 Mar 08
2
ggplot2: modifying line width and background fill color for stat_smooth()
In the example below, from
http://www.ling.upenn.edu/~joseff/rstudy/summer2010_ggplot2_intro.html
I'd like to make (a) the fitted line thicker and (b) change the
background fill color for the confidence
envelope around each fitted line to a low-alpha transparent version of
the same color used
for the separate fitted lines for GENDER, rather than grey for both.
How can I do this?
2013 Jan 21
1
Very slow in processing the equation in the scatter plot ggplot
Hello All,
I have plotted a scatter plot in ggplot2 and added a regression line and a
regression equation. But the processing is very very slow. One reason might
be because I have so many data pairs. Is there any way to speed up this
code ? I need to create a multiple layout as well.
The code I have used is as follows:
setwd("C:/Users/jzd0009/Documents/R software")
mydata <-
2010 Sep 11
1
ggplot: stat_smooth() and nls method
Hi all,
Does one of you know if there is any way to combine a "nls" method in
the stat_smooth of ggplot?
Regards
--
-------------
Benoit Boulinguiez
Ph.D student
Ecole de Chimie de Rennes (ENSCR) Bureau 1.20
Equipe CIP UMR CNRS 6226 "Sciences Chimiques de Rennes"
Avenue du G?n?ral Leclerc
CS 50837
35708 Rennes CEDEX 7
Tel 33 (0)2 23 23 80 83
Fax 33 (0)2 23 23 81 20
2011 Jun 26
1
changing graphs in qqplot2
This is what I have now so far.
p=ggplot(data = test, aes(x = YEAR, y = TOTAL, colour = TREATMENT)) +
geom_point() + geom_smooth(method = "lm", se=FALSE) + facet_wrap(~COUNTRY)
> p +scale_x_continuous(limits=c(1,4))
http://r.789695.n4.nabble.com/file/n3626510/graph.gif
I would also like to:
1.) change the headline for the faced wraps ?high? and ?low?. Is there any
other way of
2011 Oct 03
4
Question about ggplot2 and stat_smooth
I'm interested in creating a graphic -like- this:
c <- ggplot(mtcars, aes(qsec, wt))
c + geom_point() + stat_smooth(fill="blue", colour="darkblue", size=2,
alpha = 0.2)
but I need to show 2 sets of bands (with different shading) using 5%,
25%, 75%, 95% limits that I specify and where the heavy blue line is the
median. I don't understand how to do this with
2011 Jan 25
2
ggplot geom_boxplot and stat_smooth
Dear all
I would like to superpose some smoothing line through boxplot in ggplot
> dput(ad)
structure(list(konc.f = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 6L, 6L, 6L,
7L, 7L, 7L, 7L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L,
1L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 4L, 4L, 4L,
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
2009 Feb 04
5
ggplot: problem with fill option in stat_smooth()
Hi all,
I am using ggplot2 and continuing to find it very useful and pretty.
However, I am trying to create some graphics for publication that would be
included in an MS Word document (not my choice!) in Windows Vista.
The problem is that I want to use stat_smooth() to add an fitted linear
model line along with its 95% confidence band, but I cannot seem to get the
confidence band in a format
2011 Feb 10
1
Ggplot: free x-scales in a facet-grid
Hello,
I have a ggplot that has the looks of the plot that I want, but it doesn't
have the right layout.
The data is an ordered melted dataframe:
- ID
- type (to use for a faced grid)
- time - type
- time - value (POSIXct)
- pos (to use for a faced grid, this is an index to split the plot)
The goal of the plot is to create a time line for each ID (different points
of time). The ID's
2007 Jul 14
1
scaling of different data sets in ggplot
Dear list (but probably mostly Hadley):
In ggplot, operations to modify 'guides' are accessed through grid
objects, but I did not find mention of creating new guides or possibly
removing them altogether using ggplot functions. I wonder if this is
something I need to learn grid to learn more about (which I hope to do
eventually).
Also, ggplot()+geom_object() [where 'object' can be
2011 Aug 15
1
ggplot in a function confusion!
Whats going on here?
df<-data.frame(x=1:10,y=1:10)
ggplot()+geom_point(data=df,aes(x=x,y=y)) ## this is the normal usage
right?
ggplot()+geom_point(data=df,aes(x=df[,1],y=df[,2])) ## but I can also feed
it column indices
ggplot()+geom_point(aes(x=df[,'x'],y=df[,'y'])) ## or column names.
## but if i wrap it in a function...
plot.func.one<-function(dff,x.var,y.var){
2010 Aug 14
1
is it possible to map 2 plots(c and d) in a single output plot?
is it possible to map 2 plots(c and d) in a single output plot?
library(ggplot2)
c <- ggplot(mtcars, aes(qsec, wt))
d <- ggplot (mtcars, aes(qsec, wt))
c + stat_smooth(fill="darkgrey", colour="blue", size=2, alpha = 0.2)
d + stat_smooth(fill="darkgrey", colour="red", size=2, alpha = 0.2)
--
View this message in context:
2009 Dec 11
0
ggplot2: version 0.8.4
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2009 Dec 11
0
ggplot2: version 0.8.4
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2008 Sep 25
1
ggplot: adding layer using different data, groups and also controlling appearance
I have a more complicated function I am trying to write, but I run in to a problem when I want to
add something to the plot from more than one data set while simultaneously controlling the
appearance of the additional layer.
# Toy data:
foo <- data.frame ( x = 1:4, y = 4:1 , membership = c( "A", "A", "B", "B" ) )
bar <- data.frame ( x = 1:4 + 1 , y
2020 Sep 30
4
Graficar una curva de tendencia potencial.
AF_E PS_E
90.838 2.206
83.139 1.751
134.272 3.710
84.043 2.076
105.184 2.788
157.249 3.783
50.280 1.027
96.973 2.355
123.582 3.398
60.417 1.236
123.501 3.315
90.128 1.566
193.783 5.167
116.036 2.994
100.289 2.216
56.943 1.106
102.272 2.692
145.579 3.810
53.105 1.202
127.212 3.061
102.838 2.383
126.352 2.723
13.661 0.190
164.352 4.870
159.945 4.160
54.382 0.884
128.253 3.598
181.208 4.767
145.118
2012 Jan 16
1
ggplot- using geom_point and geom_line at the same time
Hi
I am plotting line chart using ggplot and want to use geom_line and
geom_point simultaneously.
I get the plot but now I have two legends. None of the legend is
representing the true values. I need the legend with shape and color both.
Thanks
> con = textConnection("inputs var1 var2 var3+ 100 10 5 2+ 1000 20 10 4+ 5000 30 15 8+ 10000 40 20 16+ 30000 50 25 32")> data =
2007 Sep 08
1
ggplot legend consolidation
Hello Everyone,
I have recently been introduced to the ggplot package by Hadley Wickham
and must say I am quite impressed so far at how easy it is to make
attractive plots, but one thing I am struggling over is how to
consolidate legends.
I have 3 plots that I would like to put on a single page and all 3 map
the same dimension of the data to the colour aesthetic. Right now, when
I plot all