Displaying 20 results from an estimated 10000 matches similar to: "Sweave and ggplot2"
2007 Apr 10
1
median polishing
Hi,
In SPlus there is a function called "twoway" for median polishing gridded
data. Is there an equivalent function in R? I have been searching for it
in R help without much success. Your help is much appreciated.
Cheers
Sorn
[[alternative HTML version deleted]]
2010 Jun 09
1
specifying plot symbol sizes in qplot or ggplot2
Hi.
first things first ... thanks for ggplot2.
Now my question. I'm using qplot to generate a plot as follows where X,Y,Z,
A are columns in a dataframe.
qplot(X, Y, data=XYDATA, color=Z, geom=c("point"), size=A)
This works as expected. Factor A has three levels so there are three sizes
of the point plot symbol. I understand that the factor levels are mapped to
symbol sizes.
2009 Apr 21
3
ggplot2 - boxplot of variables / columns
Hi,
ggplot/qplot is great - it has really helped me do some nice things.
However, simple boxplot of different columns/variables is a bit
tricky, because of (i think) qplot's generic Y conditional on X input
form. Se below.
# Some data:
a <- rnorm(100)
b <- rnorm(100,1,2)
c <- rnorm(100,2,0.5)
# normal boxplot of a,b,c
boxplot(a,b,c) # Looks good
library(ggplot2) # loads qqplot2
#
2009 Feb 26
1
bottom legends in ggplot2 ?
Has anyone had success with producing legends to a qplot graph such that the legend is placed on the bottom, under the abcissa rather than to the right hand side ?
The following doesn't move the legend:
library(ggplot2)
qplot(mpg, wt, data=mtcars, colour=cyl, gpar(legend.position="bottom") )
I am using ggplot2_0.8.2.
Thanks in advance,
Avram
2009 May 07
1
I updated/reinstalled ggplot2 and the trouble started...
Hi Ian,
Per your suggestion, I reinstalled R 2.9.0, then
I reinstalled ggplot2 on top. The problem persists.
Here's the what happens after the installation:
> qplot (carat, price, data = diamonds, alpha = I(1/10))
Warning message:
In grid.Call.graphics("L_points", x$x, x$y, x$pch, x$size) :
semi-transparency is not supported on this device: reported only once per
2009 Sep 29
2
ggplot2 box plot notches
Dear List,
I just googled to find out if notched box plots are possible with
ggplot2, but couldn't find a answer to it.
boxplot() has the option: notch = TRUE, e.g.: boxplot(mpg$hwy, notch=TRUE)
My example code (taken from the net) is:
require(ggplot2)
qplot(class, hwy, fill=factor(year), data=mpg, geom="boxplot",
position="dodge")+theme_bw()
Thank you for you help!
2007 Aug 02
1
ggplot2 qplot and add
Hi there,
I have some simple frequencies I want to plot into one graph. I had it
working, and now I can't figure out whats going wrong. All the data is
stored in a dataframe, and i finally managed to order the factor correctly!
Each column is a variable and contains integers for the same set of values
in the column that contains the headers for each row (graphLabels).
So, I get the data
2010 Sep 20
1
ggplot2 - bar colour
Hi All,
I have trying to do what I thought was a reasonably simple graph but I think
I'm now going in circles with the colour. Attached is a picture of where I'm
up to.
The line creating this is:
qplot(ageincgraph$age, ageincgraph$rate, position="dodge", stat="identity",
geom="bar" ) + aes( colour=ageincgraph$era) +
2008 Jun 10
1
Sweave, ggplot2 and two-page figures
I am using Sweave to generate a document in which ggplot2 figures are
embedded. I am using the following code in a particular plot within a
subfloat environment:
<<qplotARbosreg, echo = FALSE, fig = TRUE>>=
print(qplot(bosday2, Arday2, data= arbostimearonlyNArm,
colour=factor(bos2), shape=factor(bos2), size=factor(cumARscore),
position="jitter", main="Days to BOS by
2009 Feb 26
1
ggplot2: labels points with different colors or idnumbers
Dear list,
Using ggplot2 I could produce both boxplot and points in the same plot but instead of points I would like to label the different
subjects with different colors or their idnumbers. Is there away to do it? Also how can I put three plots on the same graph with ggplot2?
mfrow=c(3,1) did not do the job.
> dat
group time id freq
1 1 00 0018 5.21
2 1 00 3026 3.13
2009 Mar 11
1
Ggplot2: saving a grid with multiple plots
Hi all,
I have managed to create a figure on the screen with multiple plots in
it. Something like the example below. When I save that with ggsave(),
only the last plot gets saved (pPath in the example) instead of the
entire figure. Any suggestions how I can save this kind of figures
automated?
Thanks,
Thierry
library(ggplot2)
pPoint <- qplot(unemploy/pop, psavert, data=economics)
pPath
2009 Jan 22
1
ggplot2
I have been struggling to get the legends in ggplot2 right or do away with them altogether (on which I have already sent a post).
In the following code, the labels argument in the scale_colour_gradient2 does not give me the desired labels in the legend. Could someone explain?
qplot(Year,CDR,data=b3,colour=Phase,geom=c("point","line"),legend.position="bottom")->p
2009 Feb 11
2
Label bars in a faceted bar plot in ggplot2
Hi List,
I am running R 2.8.0 on a Windows XP machine, running ggplot2 version 0.8.1
I want to label the bars in a faceted grid barplot. Reproducible R
code is given below:
#### reproducible facet barplot #####
library(ggplot2)
# Dataset from which to create the barplot
ml <- rep(1:10,2)
vals <- rnorm(20,mean = 10, sd=1)
type <- c(rep("MAPE",10),rep("AIC",10))
2009 Jun 17
3
lattice: axis ticks, axis alignment and remove axis from plot
Hi there,
I'm a bit confused concerning the axis tck setting in the lattice
package as the ticks on left sided axis aren't
drawn at all with the following setting:
dados <- data.frame(varsep = factor(rep(1:2,10)),
i = runif(20))
library(lattice)
my.theme <- list(
axis.components = list(left = list(tck = 1, pad1 = 1, pad2 =
2), top = list(tck = 0, pad1
2008 Mar 25
2
ggplot2 - facetting
Dear All,
After having overcome the issue of legends (thanks, Thierry, once
more), I am trying to use facetting, but here also I can not find how
to do this. I do not want to use qplot, but rather the more flexible
options. However, it seems I am doing still something pretty stupid,
because I always get an error, even if it seems I am doing everything
like the examples.
My code is below.
2009 Jun 10
1
ggplot, qplot: alpha channel for colors corresponding to factor
Hi,
I have a qplot like the one in the minimal example below, except I
also have faceting like this:
qplot(jitter(Goodall),jitter(Better.adapt),colour=Second.adapt,facets=~Pol,data=d1)
and with the real data I get quite a lot of overplotting, so I would
like to add an alpha channel.
In addition, I would like to be able to control which colors are used
for each value of Second.adapt (which
2008 Jun 23
1
ggplot2-barplot
Hi all:
I have been using ggplot2 graphics for quite some time now and I really like it. However, I haven't used barplots enough to understand the arquitecture behind it. Can someone show me how to make this simple barplot graph with ggplot2? I want "PondName" along the x axis and "avgWt" along the Y axis which represents the avgWt by each Pond.
PondName avgWt
Pond01 21.5
2011 Jan 05
3
Adding lines in ggplot2
Hello,
this is probably a recurrent question, but I couldn't find any answers that
didn't involve the expression "data frame"... so perhaps I'm looking for
something new here.
I wanted to find a code equivalent to
> x=sqrt(1:10)
> y=log(1:10)
> plot(1:10, x, type="lines", col="darkgreen")
> lines(1:10, y, col="red")
to use with
2008 Feb 27
1
how to specify ggplot2 facet plot order
Hi, new to R and ggplot2. I've been trying to get a facet plot in which the
order of the facets is as I require, rather than ordered numerically,
alphabetically, by Roman numerals, mean (answers to these were posted here
after much searching). Here's some test code to demonstrate what I get.
series = c('C2','C4','C8','C10','C15','C20')
ids =
2010 Nov 30
2
ggplot2 histograms
Hi
With ggplot2 I can very easily create beautiful histograms but I would like to put two histograms on the same plot. The histograms may be over-lapping.
When they are overlapping the bars are shown on top of each other (so that the overall height is the sum of the two). Is there any way to get them to display overlapping (with smaller value in front, larger value behind) so that the overall