Displaying 20 results from an estimated 4000 matches similar to: "Reversing xlim qplot"
2008 Sep 15
4
getting data into correct format for summarizing ... reshape, aggregate, or...
I would like to reformat this data frame into something that I can
produce some descriptive statistics. I have been playing around with
the reshape package and maybe this is not the best way to proceed. I
would like to use RiverMile and constituent as the grouping variables
to get the summary statistics:
198a 198b
mean mean
sd sd
... ...
etc. for all of these.
I have tried
2008 Oct 14
1
ggplot2 plot with symbols and then add line
r <-(structure(list(TSS = c(2.8, 8.4, 11, 1.3, 4.2, 2, 3.4, 14, 8.2,
3.1, 1.4, 0.9, 0.5, 6.1, 9.2, 0.6, 1, 11, 2.4, 1.2, 1.3, 1.3,
0, 1.8, 8, 11, 11, 8.5, 8.5, 1.8, 13, 4.4, 1.4, 2.1, 0.5, 25,
25, 9.3, 6.1, 1.6, 1.5, 19, 19, 24, 9.6, 1.8, 1.4, 1), GPP = c(1.213695235,
3.817313822, 1.267930498, 10.45692825, 3.268295623, 3.505286001,
4.468225245, 0.915653726, 1.635617261, 3.726133898,
2008 Sep 24
2
lattice xyplot symbols instead of colors and legend matching plot symbols or colors
I would like to use the data below where the plots are close to what I
want. Instead of color I would like to use different symbols, and
have the symbols in the legend match the graphs. I am also going to
add a regression line to these I know about the type="r" (which is
fine for these particular graphs) argument, but it fits the subsets
instead of the entire data set-- should I use a
2008 Oct 31
1
reshape bug?
Hadley et al.,
I was using the cast function to reshape some data (aggregate a melted
data frame) and I did not put in the fill and for the most part the
values that came out were fine, but there were value great than an
order of magnitude from the actual value. When I put in the fill
argument everything is okay. I don't provide a reproducible example
because the data set is to large to post
2008 Oct 09
1
nls, lattice, and conversion over to ggplot
I am trying to figure out how to use ggplot2. I would like to do the below
with ggplot, but I can not figure out how. The data provided is a subset of
a much larger data set, but these data are the data necessary to make the
plot. I think I would rather have the colors become symbols, and I do know
how to do that in lattice, but here is a quick and dirty version.
thanks
r
2008 Dec 02
1
ggplot2 facet_wrap problem
Hadley,
I don't know if I am doing something wrong or if it is ggplot please
see the two graphs at the bottom of the page (code).
melt.nut <- (structure(list(RiverMile = c(119L, 119L, 119L, 119L, 119L, 119L,
119L, 119L, 119L, 148L, 148L, 148L, 148L, 148L, 148L, 148L, 179L,
179L, 179L, 179L, 179L, 179L, 179L, 185L, 185L, 185L, 185L, 185L,
185L, 185L, 190L, 190L, 190L, 190L, 190L, 190L,
2008 Apr 29
1
merging multiple data frames with different numbers of rows
merge can only merge two objects at a time- I would like to merge more than
two objects at a time.
s.d <- structure(list(RiverMile = c(202L, 198L, 190L, 185L, 179L, 148L,
119L, 61L)), .Names = "RiverMile", row.names = c(NA, -8L), class =
"data.frame")
#s.d is all of the river miles that can occur in all of the data frames that
I want to put together
feb06 <-
2008 Oct 22
1
plotting matrix
a <- c(1:26)
b <- rnorm(25)
e <- rnorm(25)
f <- rnorm(25)
g <- data.frame(b,e, a,f)
I would like to plot a agianst all possibilities and then shoot it out
to a pdf one graph per page. I think it would be okay to have this as
a lattice plot or a ggplot with many graphs per page. I can figure
all of that out I think, but I need something like
r <- as.matrix(g)
plot(.~a, data=r)
2008 Apr 29
1
data management (subsetting and recombining)
This is an example of two months of data from a twenty four month data set
that I would like to apply this too. These data are subsets of the same
stations throught time, but differing ones were included on different
sampling dates. I would like to subset these data and then put them
together as a big matrix with the by column being RiverMile. What is the
easiest way to proceed as this is a
2008 Oct 13
1
ggplot faceting like lattice | variable
I would like to be able to do the xyplot in ggplot below. I read in
the archive that Hadley was working on this for the next release, and
I can not find the documentation (Aug. 23rd).
River.Mile <- c(215 ,202, 198, 190, 185, 179, 148, 119, 61)
Cu <- rnorm(9)
Fe <- rnorm(9)
Mg <- rnorm(9)
Ti <- rnorm(9)
Ir <- rnorm(9)
r <- data.frame(River.Mile, Cu, Fe, Mg, Ti, Ir)
z <-
2009 Jan 07
1
Replace Function (How to replace numbers in a data frame with a specific number)
taxa <- (structure(list(Date = structure(c(4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), .Label = c("2006/04",
"2006/05", "2006/07", "2006/10", "2006/12", "2007/02", "2007/04",
"2007/06", "2007/08", "2007/10", "2007/12", "2008/01"), class =
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)
>
2008 Oct 10
2
ggplot adding points
I would like to do the following in ggplot:
what am I missing?
River.Mile <-c(202, 198, 190, 185, 179, 148, 119, 61)
TSS <- c(1:8)
DOC <- seq(2, by= 0.6, length.out=8)
z <- data.frame(River.Mile, TSS, DOC)
xyplot(TSS+DOC~River.Mile, data=z, auto.key=TRUE)
thanks
--
Stephen Sefick
Research Scientist
Southeastern Natural Sciences Academy
Let's not spend our time and resources
2008 May 12
1
Converting qqplot2 qplot() to grammar?
Hello all,
I've been using the following qplot command:
qplot(pixX,pixY, data=som, geom="tile", fill=rgb) +
scale_fill_identity() + opts(aspect.ratio = .75) + facet_grid(unitX ~ unitY)
Now I would like to convert it into the explicit ggplot grammar, so I
can remove the extras: axes, labels, background, borders, facet labels,
and extra white-space around the plot. (If anyone has
2008 Dec 24
2
ggplot2 Xlim
Hi: I need some help.
I am ploting a bar graph but I can't adjust my x axis scale
I use this code:
i <- qplot(ForkLength,Number,data=FL,geom="bar")
i + geom_bar(colour="blue",fill="grey65") # too crowded
FL_dat <- ggplot(FL,aes(x=ForkLength,y=Number)) + geom_bar(colour="green",fill="grey65")
FL_dat +
2008 May 06
4
General Plotting Question
f <- (structure(list(X = structure(96:97, .Label = c("119DAmm", "119DN",
"119DNN", "119DO", "119DOC", "119Flow", "119Nit", "119ON", "119OPhos",
"119OrgP", "119Phos", "119TKN", "119TOC", "148DAmm", "148DN",
"148DNN", "148DO",
2008 Oct 19
1
zoo in ggplot2
library(zoo)
d<-(structure(c(1.39981554315924, 0.89196314359498, 0.407816250252697,
0.823496839063978, 1.14429021220358, 1.23971035967413, 0.960868900583432,
0.927685306209829, 1.22072345292821, 0.249842897450642, 1.00879641624694,
0.925372139878243, 0.317259909172362, 0.382677149697482), index =
structure(c(11808,
11869, 11961, 11992, 12084, 12173, 12265, 12418, 12600, 12631,
12753, 12996,
2009 Jan 29
2
Adding vertical line to histogram and qplot "stacked" plot
R-users it appears I am leaning on your knowledge once again. Is there any way to add a vertical line to a histogram and qplot "stacked" plot? Here is my current attempt:
"qplot" approach attempt:
qplot(Run, data = data_dataframe, breaks = breaks, fill = Temperature, main = short_title) + scale_x_continuous("Data") + scale_y_continuous("Freq")
2009 Jan 28
1
Changing histogram stack in qplot
I've been using qplot pretty successfully to generate stacked histograms. However, it appears that I need to tweak the colors a little.
I've got three temperature variables (characters not numeric) and I need to change from the default qplot colors to the following:
Low = Blue
Middle = black
High = Red
Here is pseudo code of what I have currently:qplot(Run, data = TestData, breaks =
2009 Dec 15
1
for loop for automatic pdf generation
I know this is not reproducible, but I don't want to clog up mail
boxes with the data frame. I would be happy to send this off list. I
am sure that I am missing something simple. The plotting works if I
just paste the call to qplot into R and replace the [i] with a number.
Thanks for all of your help in advance.
#loop to spit out PDFs
list.names <-