Displaying 20 results from an estimated 10000 matches similar to: "ggplot2 boxplot: horizontal, univariate"
2012 Feb 06
1
ggplot2 geom_polygon fill
Hi everyone,
i've been trying to make a special plot with ggplot2, but I can't get it to
fill the polygon I'd like to see filled so very very much.
I want to display the difference or change in the distribution of the
modified Rankin Scale between two groups. mRS is a scale for disability or
daily activities competence.
It looks like this.
2011 Oct 04
1
ggplot2: changing default colors of boxplot
Hi,
I wanted to change the default colors appearing in boxplot. For example, the
following code (from the package/documentation):
===========
library(ggplot2)
p <- ggplot(mtcars, aes(factor(cyl), mpg))
p + geom_boxplot(aes(fill = factor(am)))
===========
Gives the default colors. What do I need to do to modify this so that:
1. Change the colors from green and red to blue and black
2. Only
2009 Jan 24
2
ggplot2 - how to change location / position of wind rose axis labels?
Dear R users,
First just want to say thank you to all for developing such a wonderful
software and packages.
I need to produce a wind rose plot. Tried with packages circular and plotrix
and couldn't quite get what I want. Moved to package ggplot2 and it's going
great. However stuck in how to move axis labels.
I am using the wind rose from the help to learn how to do what I need (code
2011 Oct 18
3
Ordering of stack in ggplot (package ggplot2)
I'm trying to reproduce the 3rd graph on the page of this site:
http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ . However, the data
below produces a ggplot with the stacks sorted in alphabetical order from
the bottom up. I'd like the stacks to be in the order "Europe", "Asia",
"Americas, "Africa", "Oceania". Is there an easy way to
2009 Aug 12
1
A function for plotting a boxplot with added dot and bars (for mean and SE) - please help improve my code
Hello people,
A while back I wanted to plot boxplots with interactions that will have a
dot for the mean of the sample + bars for the SE.
After searching for some code, I found something that did it for one level,
but couldn't find something that will allow for interactions the way the
original boxplot does.
After playing with the original code, I found a way for allowing the boxplot
code to
2008 May 07
1
Not to draw the xaxis ticks in ggplot2
>library(ggplot2)
>(p<- qplot(mpg, wt, data=mtcars))
What I am doing is to set color of the ticks to hide them.
>grid.gedit(gPath("xaxis", "ticks"), gp=gpar(col="white"))
It should be a better way to achieve the purpose. Thanks.
2010 Feb 04
4
xyplot 3 panels 3 different Y variables
Often, when exploring a dataset, I'd like to plot several very different Y variables against the same X variable, in panels stacked one over the other. Is there an easy way to do this?
I'd like to achieve an elegant look similar to the look achieved by lattice in conditioned plots--for instance no space between panels. But unlike in straightforward conditioned plot, each panel may be on a
2010 Dec 06
2
ggplot2: Controlling line width of panel borders
Dear R-users,
i encountered some problems when trying to adjust the line width of the
axes and stripes in a plot created with ggplot2.
I use the "barley" dataset of the lattice package to illustrate my problem:
library(ggplot2)
library(lattice)
barley[["SD"]] <- 5
limits <- aes(ymax=barley$yield + barley$SD,ymin=barley$yield - barley$SD)
p1 <-
2009 Oct 12
3
xyplot does not find variable in data
When we call a lattice function such as xyplot, to what extent does
the "data" designation cause the function to look inside the "data"
for variables?
In the examples below, the "subset" argument understands that
"Variety" is a variable in the data.
But the "scales" argument does not understand that "nitro" is a
variable in the data.
2011 Nov 08
3
ggplot2 reorder factors for faceting
Dear List
I am trying to draw a heatmap using ggplot2. In this heatmap I have faceted my data by 'infection' of which I have four. These four infections break down into two types and I would like to reorder the 'infection' column of my data to reflect this.
Toy example below:
library(ggplot2)
# test data for ggplot reordering
genes <- (rep (c(rep('a',4),
2009 Jul 26
1
obtain names of variables and data from glm object
Suppose we have some glm object such as:
myglm <- glm( y ~ x, data=DAT)
Is there an elegant way--or the "right way" within the R way of thinking--to
obtain the names of the response variable, the predictor variables, and the
dataset, as character strings?
For instance, suppose the "right way" was to use the (currently fictitious)
functions theresponse(), thepredictors(),
2009 Aug 03
3
session logging
Consider all the text that one sees on the console during an R session.
Is there a way, within R, to make all this text--both the "output" and the "messages"--automatically get copied to a single text file, in addition to seeing it on the console?
If I remember to save the console to a file at the end of my R session, that does it. But
(1) That requires pointing and
2011 Aug 24
1
Scatter plots, linear regression in ggplot2
Hi,
Based on some modification that I did to the R Cookbook Graphs Scatterplots
code, link:http://wiki.stdout.org/rcookbook/Graphs/Scatterplots%20(ggplot2)
I have some questions and I will appreciate a help:
- How do I change the legend title?
- How can I change the for each linear regression its color and linetype?
- How can I add for both the linear regression lines their equations and
Rseq
2010 Mar 04
2
fisher.test gives p>1
The purpose of this email is to
(1) report an example where fisher.test returns p > 1
(2) ask if there is a reliable way to avoid p>1 with fisher.test.
If one has designed one's code to return an error when it finds a "nonsensical" probability, of course a value of p>1 can cause havoc.
Example:
> junk<-data.frame(score=c(rep(0,14), rep(1,29), rep(2, 16)))
>
2009 Oct 10
1
lattice auto.key drop unused levels
The following code produces a legend ("key") that mentions the unused
levels of Block.
library(MEMSS)
xyplot(yield~nitro, subset=(Block=="I" | Block=="II"), data=Oats,
group=Block, auto.key=T)
and adding "drop.unused.levels=T" does not fix it. And in fact even
the following does not solve the problem:
xyplot(yield~nitro,
2013 Dec 02
2
plus/minus +/- in factor; not plotmath not expression
I want to put the "plus or minus" symbol into a character variable, so that this can be turned into a factor and be displayed in the "strip" of a faceted ggplot2 plot.
A very nice solution, thanks to Professor Ripley's post of Nov 16, 2008; 3:13pm, visible at http://r.789695.n4.nabble.com/Symbols-to-use-in-text-td874239.html and subsequently
2011 Nov 10
1
unable to load Hmisc in R 2.14.0
On my MacBook Pro (OS 10.6.8), after updating to R version 2.14.0 (2011-10-31) and reinstalling the Hmisc package, I am unable to load the Hmisc library.
Hmisc was working *before* I updated R.
Any idea what's wrong?
Details below.
> install.packages("Hmisc", dependencies=TRUE)
trying URL
'http://cran.case.edu/bin/macosx/leopard/contrib/2.14/Hmisc_3.9-0.tgz'
Content
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!
2009 Oct 28
3
variable labels to accompany data.frame
Often it is useful to keep a "codebook" to document the contents of a dataset. (By "dataset" I mean
a rectangular structure such as a dataframe.)
The codebook has as many rows as the dataset has columns (variables, fields). The columns (fields)
of the codebook may include:
? variable name
? type (character, factor, integer, etc)
? variable label
2007 Oct 01
4
how to plot a graph with different pch
I am trying to plot a graph but the points on the graph should be
different symbols and colors. It should represent what is in the legend.
I tried using the points command but this does not work. Is there
another command in R that would allow me to use different symbols and
colors for the points?
Thank you kindly.
data(mtcars)
plot(mtcars$wt,mtcars$mpg,xlab= "Weight(lbs/1000)",