Displaying 20 results from an estimated 200 matches similar to: "ggplot2 reorder factors for faceting"
2012 Aug 13
4
write.dbf error: invalid subscript type 'list'
Dear all,
I am basically a GIS user and am new to R.
I am trying to write a data frame to a dbf file.
*n.simulations <- 999
binomial <- kulldorff(geo, cases, population, NULL, pop.upper.bound,
n.simulations, alpha.level, plot)
cluster <- binomial$most.likely.cluster$location.IDs.included
df <- data.frame(ID=seq(1,n.simulations,by=1),
simloglkhd=binomial$simulated.log.lkhd)
2010 Nov 20
2
Merge two ggplots
Hello everyone.
I am using ggplot and I need some help to merge these two plots into one.
plot_CR<-function(x,y,agentid,CRagent){
library(ggplot2)
agent<-CRagent[[agentid]] # To make following expression shorter
ggplot((data.frame(x=CRX,y=CRY,sr=agent$sr)))+
geom_point(aes(x,y,colour=cut(sr,c(0,-10,-20,-30,-40,-50,-60,-70,-80))))+
geom_text(aes(x,y,color=cut(sr,
2000 Jul 07
2
Question of programming style
This is really a question of how to program this *BETTER*. It works as I have
done it, but is quite ugly.
I want to do a 3d scatterplot of the upper triangle of a matrix, where the
z-values are the values in the matrix, and the row and column indices are the y-
and x-values. The complete (11 by 11) matrix is mmtop94.2. Here is my awkward
code:
mmtop94.2[lower.tri(mmtop94.2)] <- NA
# Here i
2010 Jul 08
1
xyplot help
Hi, I am learning xyplot. I have an example dataset attached.
plotdata<-read.table("plotdata.txt",sep='\t',header=T,row.names=1)
head(plotdata,n=4)
y x type
1 -4.309601 -0.7448405 A
2 -4.715421 0.7875994 A
3 -2.310638 0.5455310 A
4 -2.685803 10.4116868 A
xyplot(y~x,groups=type,plotdata, auto.key=T)
This shows different colors for different
2008 Nov 04
1
How to create margin area around a graphic made by xyplot
Hi list,
Does any body know how I can create a margin area around the graphic created
by xyplot (the same thing we do using par in plot function)? I tried
viewport, but does not work.
Here is the code:
==============================================
require(grid)
vp<- viewport(x=.1,y=.1,width=.6,height=.6,just=c("left", "bottom"))
pushViewport(vp)
2008 Oct 30
2
xyplot, the first tick mark starts from 2 rather than 1, and also there is a NA as the final tick mark.
I am trying to plot some data, but have got some difficulties with labels on
the tick marks on the x-axes. There are 20 data points. All I want to do is
to plot the Loss versus Lines. When I use xyplot, the first tick mark starts
from 2 rather than 1, and also there is a NA as the final tick mark.
Here is the R code you code give it a try:
Would any body be able to fix this, please?
2015 Sep 29
8
[PATCH 0/7] copy-in/copy-out: Capture errors from tar subprocess (RHBZ#1267032).
Commits 3c27f3d91e1566854747bbe844186783fc84f3a8 and
1b6f0daa9ae7fcc94e389232d0c397816cda973d added an internal API for
running commands asynchronously. It is only used by the copy-in and
copy-out APIs.
Unfortunately this made the command code very complex: it was almost
impossible to redirect stderr to a file, and there were a lot of
long-range dependencies through the file. It was also buggy:
2008 Sep 09
6
plotting group means
Hi all,
I want to plot the grouped means of some variables. The dependent variables
and the grouping factor are stored in different columns. I want to draw a
simple line-plot of means, in which the x-axis represents the variables and
y-axis represents the means. The means of the groups should be connected by
lines. So far, the only function that I could find comes closest to what I'm
2015 Feb 02
8
[PATCH 0/7 v2] Make copy_in & copy_out APIs, and use copy_in in customize
Hi,
attached there is the second version of the patch series adding
copy_in and copy_out in the library, mostly moving them from guestfish.
It also adds the copy_in usage in virt-customize, as aid in a new image
building.
Thanks,
Pino Toscano (7):
cmd: add a way to run (and wait) asynchronously commands
cmd: add a child-setup callback
cmd: add the possibility to get a fd to the process
2007 Dec 11
2
ggplot - Setting the y-scale in a bar plot
Dear All (probably Hadley),
I am now trying to customise some plots using a bar geom.
I do not want to use the default binning statistic, but rather
calculate the bar heigths separately. I do manage this, but for
comparison purposes I would like to have a set of plots all with the
same y-axis height. But I do not seem to find out how to fix the
scale of the y-axis in this case.
Any tips?
2007 Oct 31
1
reversing the scale on ggplot
Dear All,
I am trying to build a simple ggplot, but where the scale is
reversed, i.e. the largest numbers are on the bottom.
An example of the code I am using is
> plotdata<-data.frame(x=1:10, y=runif(10))
> plot<-ggplot()
> plot<-plot+layer(data=plotdata, mapping=aes_string(x='x',y='y'),
geom='point', stat='identity', size=4)
>
2015 Jan 26
6
[PATCH 1/6] cmd: add a way to run (and wait) asynchronously commands
---
src/command.c | 64 +++++++++++++++++++++++++++++++++++++++++++-------
src/guestfs-internal.h | 3 +++
2 files changed, 58 insertions(+), 9 deletions(-)
diff --git a/src/command.c b/src/command.c
index 4bb469b..e26573d 100644
--- a/src/command.c
+++ b/src/command.c
@@ -360,7 +360,7 @@ debug_command (struct command *cmd)
}
static int
-run_command (struct command *cmd)
2011 May 10
1
ggplot2 and add circle
Dear all,
today I have writted the following code,
to plot the contents of some matrices I have
plot_shad_f
function(f){
library(ggplot2)
dev.new()
plotdata<-melt(f)
names(plotdata)<-c('x','y','z')
v<-ggplot(plotdata, aes(x, y, z = z))
print(v + geom_tile(aes(fill=z)))
}
I would like to ask your help add a small circle in this plotting. What would be
2004 Sep 26
1
(no subject)
Hello R help mailing list,
I'm having difficulty saving a series of figures in an
analysis. I have attempted to save them in a for loop with
the following code:
for(i in 1:20){
sF<-paste("fig",i,".jpeg",sep="")
jpeg(file=sF,width=600,height=500,quality=100,pointsize=12)
attach(plotData)
xyplot(CHC~1:13),
detach(plotData)
graphics.off()
}
If I break
2009 Aug 20
1
lattice xyplot strip colors and location
Hi all,
I've been trying (unsuccessfully) to modify an xyplot I created using the lattice package. I would like to change default strip colors and locations.
I started with numeric data in 4 columns, which look like this:
0.25 2 1 32
0.25 2 2 30
0.25 2 3 27
0.25 2 4 23
0.25 2 5 17
0.25 3 1 30
0.25
2004 Aug 25
2
[Q] Apply Function Over Multiple Array Margins
Is there a canonical means to apply a function
over multiple arrays simultaneously? For example,
if I wanted to plot each line with a different color?
Or is a for loop conversion my best option?
x <- seq(0, 8, by = 2)
y <- matrix(1:15, nrow = 5, byrow = TRUE)
my.colors <- heat.colors(3)
drawLines <- function(row) {
lines(x, row) # want corresponding 'my.colors' here
}
2007 Nov 01
1
ggplot2 - expand range?
Dear UserRs,
I am trying to use systematically ggplot2 for most of my plots, but I
am fighting some lack of documentation, which I try to overcome.
I want to build a scatterplot where the axes cross exactly at (0,0).
I tried using scale_y_continuous(limits=c(0,10)), but I always get an
extra space at the bottom of the axes. The code I used is below.
> plotdata<-data.frame(x=1:10,
2008 Dec 28
5
playing with Wine on Cygwin
I'm currently playing with Wine on Cygwin on Windows 2000 on
VirtualBox. Just to see what happens. Also to see how feasible Wine on
Windows is from here.
I've been updating the http://wiki.winehq.org/CygwinSupport page accordingly.
With the 1.1.11 source tarball, I'm getting a compile error:
internettransport.c:348: error:
2005 Mar 31
2
pictex graphics device and color
Is the pictex graphics device known not to support color?
In R 2.0.1 Patched (2004-11-17), it produced very pretty output:
## pictex(file = "modern-metatheonomy.tex", bg = "transparent");
## plotData(data);
## dev.off()
... but it appears to have ignored all color information.
__________
Steve Rowley <steve.rowley at sanofi-aventis.com> Cambridge, MA: (617) 768-4054
2012 May 16
2
[LLVMdev] NVPTX: __iAtomicCAS support ?
Dear colleagues,
I'm looking if we can replace nvopencc with LLVM NVPTX in our project.
It turns NVPTX won't work with the code nvopencc can handle (please
see the log below). So are atomic intrinsics not supported or am I
doing call in a wrong way?
Thanks,
- Dima.
SOURCE
========
dmikushin at hp2:~> cat kernelgen_monitor.ll
; ModuleID =