Displaying 20 results from an estimated 2000 matches similar to: "Ggplot2: saving a grid with multiple plots"
2009 Jan 22
1
ggplot2 example
I need to plot two graphics just like the example below but for some reason your example crashes. Using facet_wrap seems to be the cause:
library(ggplot2)
upper <- with(economics, data.frame(date,value = psavert, position = "upper"))
upper
lower <- with(economics, data.frame(date,value = unemploy,position = "lower"))
lower
#upper$date <-
2013 Apr 14
1
Problem plotting continuous and discrete series in ggplot with facet
I have data that plots over time with four different variables. I would
like to combine them in one plot using facet_grid, where each variable gets
its own sub-plot. The following code resembles my data
require(ggplot2)
require(reshape2)
subm <- melt(economics, id='date', c('psavert','uempmed','unemploy'))
mcsm <- melt(data.frame(date=economics$date,
2009 Jul 22
1
Link to documentation in another package
Dear all,
One of the functions that I wrote (ggsave.latex) extents the
functionality of a function (ggsave) in another package (ggplot2).
Instead of copying all the information I would like to create a link in
the helpfile of ggsave.latex to the helpfile of ggsave. I tried
\code{\link{ggsave}} and \code{\link{ggplot2::ggsave}}, but neither
worked. Both cases gave a 'missing link' warning.
2006 Mar 23
1
nlme for groupedData with inner and outer factors
Hello,
I am having trouble specifying a suitable nlme model.
My data structure is described by
gd <- groupedData(ppath ~ lcut | exp, outer = ~ bait, inner = ~ weight, data
= d)
i.e. the response (ppath) of several subjects (sub) was measured at levels
of a continuous variable (lcut). Subjects were given either of one level of
a factor (bait), and all subjects were measured at two levels
2009 May 14
1
text() to label points in ggplot
is there a way to label points in a graph using text(locator(1),"text")
after ggplot() or qplot() ?
> qplot(date, psavert, data = economics, geom = "line",main="jhdjd")->p
> p+opts(text(locator(1),"HHHH"),new=T)
does not work.
--
View this message in context: http://www.nabble.com/text%28%29-to-label-points-in-ggplot-tp23545135p23545135.html
Sent
2012 Mar 05
2
ggplot2
I just updated to R 2.14 with ggplot2 0.9 and am finding bugs.
> ggplot2 "GPL-2" "2.14.0"
This example is taken from pg 101 in the ggplot book.
> plot <- qplot(date, psavert, data = economics, geom = "line") +
> ylab("Personal savings rate") + geom_hline(xintercept = 0, colour =
> "grey50")'
> plot +
2009 Aug 17
0
Matching two series
Dear all,
I am struggling with a problem and I am hoping that somebody could point
me in the right direction.
I am trying to match the locations of two peak patterns. A is the true
pattern. B is the measured pattern. Hence A and B have a very strong
linear relationship. The problem is that B can contain false positives:
peaks due to noise instead of the true pattern from A. An additional
problem
2008 Oct 23
1
Automating citations in Sweave
Dear all,
Is there an elegant way to add citations of packages when using Sweave?
Ideally I'd like a function which creates a Bibtex-file with the
packagenames as keys. The idea is to use \cite{packagename} or \cite{R}
in LaTeX.
I know you can get the Bibtex entry with
toBibtex(citation("packagename")). But after updating R or a package one
needs to update the bib-file too. When
2009 Jul 16
0
Cryptic error with Roxygen
Dear all,
I'm using Roxygen for the first time and I'm getting a rather cryptic
error message. I must be doing something wrong but I have no clue what
is it. Any suggestions?
Regards,
Thierry
roxygenize("AFLP", roxygen.dir = "AFLP", copy.package = FALSE,
unlink.target = FALSE)
Writing AFLP.outlier to AFLP/man/AFLP.outlier.Rd
Writing AFLP.outlier to
2013 Nov 26
0
[LLVMdev] Help needed with a pass
I'm a newbie to LLVM and I've really been struggling to write a pass which changes the behavior of the following function:
#include<stdlib.h>#include<stdio.h>#include<string.h>void foo(char* bar){const char* path;path=getenv(<SOME_ENV_VAR>);
if (path!=NULL){strcpy(bar,path);}else{printf("env_var not set!");}}
In the pass, I hope to invoke
2009 Apr 17
2
Generate bivariate binomial data
Dear all,
Could someone point me to a function or algorithm to generate random
bivariate binomial data?
Some details about what I'm trying to do. I have a dataset of trees who
were categorised as not damaged or damaged. Each tree is measured twice
(once in two consecutive years). The trees can recover from the damage
but the data is clearly correlated. As a (un)damaged tree is more likely
2009 May 19
2
Coord_equal in ggplot2
Dear all,
I'm plotting some points on a graph where both axes need to have the
same scale. See the example below. Coord_equal does that trick but in
this case it wastes a lot of space on the y-axis. Setting the limits of
the y-axis myself was no avail.
Any suggestions to solve this problem?
library(ggplot2)
ds <- data.frame(x = runif(1000, min = 0, max = 300000), y = runif(1000,
min =
2001 Mar 20
1
office
Hi All,
I Am new to Wine, and I try to get Office 97 to work, but the M$ Office
installer dosen't work yet. Se bug 150 on:
2005 Aug 24
1
PowerPoint 2000 freezing with some presentations...
Hi all!
I am having some problems with PowerPoint 2000 running in a wine
0.0.20050725-1 debian package. It works fine when I am creating a new
presentation, but when I am opening old presentations it freezes after
displaying the first slide and I am unable to even exit from ppoint. The
console shows the following:
err:syslevel:_EnterSysLevel (0x7f117380, level 2): Holding 0x7fb1fea0,
level 3.
2009 Apr 22
1
Gee with nested desgin
Dear all,
Is it possible to incorporate a nested design in GEE? I have
measurements on trees that where measured in two years. The trees are
nested in plots. Each plot contains 24 trees. The number of plots is 72.
Hence we would expect 2 * 24 * 72 = 3456 data points. A few are missing,
so we end up wih 3431 data points.
This is what I have tried until now.
#assuming independence between trees
2009 Feb 04
0
Two issues with ggplot2 - grid.gedit doesn't work from source file & grid.gedit effects are not preserved
Code for this post is shown below.
Two issues:
(1) grid.gedit doesn't work from source file
Reproduce - copy the code shown below into an R source file, and of course save off in the appropriate location. Then copy the the first line "source("C:/TestCode.R")" into R and run. Notice that you get the following error:Error in editDLfromGPath(gPath, specs, strict, grep,
2009 Aug 20
1
ggsave to .png bug in ggplot2 (?)
Text is really small and legend boxes are huge in this plot when saved to
.png with ggsave. Plot is correct (i.e. looks the same as the screen) when
saved with dev.print. Saving to .pdf with ggsave give the correct output.
I'm a noob at ggplot2 so this may be user error rather than a bug. However
the interface to ggsave seems simple enough to exclude many possibilities
for screwing this up
2008 Dec 16
1
Prediction intervals for zero inflated Poisson regression
Dear all,
I'm using zeroinfl() from the pscl-package for zero inflated Poisson
regression. I would like to calculate (aproximate) prediction intervals
for the fitted values. The package itself does not provide them. Can
this be calculated analyticaly? Or do I have to use bootstrap?
What I tried until now is to use bootstrap to estimate these intervals.
Any comments on the code are welcome.
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) +
2013 Aug 26
0
Problemas con ggsave(paste('img/', plotName, '.png', sep='')
Estimado Linis,
Si estás bajo Windows y no has cambiado las rutas (también dentro de las
funciones) es posible que no funcionen bien. Por ejemplo la sentencia
paste('img/',plotName,'.png', sep='')
deberías cambiarla por:
paste('img\',plotName,'.png', sep='')
o incluso por
paste('img\\',plotName,'.png', sep='')