Displaying 20 results from an estimated 3000 matches similar to: "black and white in qplot? layout 4 graphs in one screen"
2010 Jun 10
1
Order labels in qplot() - ggplot2 {help}
Hello,
I want to arrage the label according to my preference eg.. (va, vp, a, b,
c) but don't know how to supress default ordering. Any
suggestions?
Please try the code below:
n <- c("va", "vp", "a", "b", "c")
p <- c(2, 2,1, 3,5)
pm<- c(3,4,2,5,4)
pn <- c(1,1,1,2,3)
x<-data.frame(cbind(n,p,pm,pn))
library(ggplot2)
qplot(x=n,
2010 Jun 16
2
qplot
Hello,
I am a new r-user, and after a great effort I have made this fantastic
figure with qplot:
qplot(ROI, CBF, fill=factor(Carrier), data=combinedboxplot_dataset_se_1_CBF,
geom="boxplot", position="dodge",xlab=NULL,ylab=("CBF,white
matter-normalized"),main=("Differences between carriers and non-carriers on
baseline"))+theme_bw()
Can anyone help me
2010 Jun 30
2
ggplot qplot bar removing bars when truncating scale
I'm having problems with this example, it is posted with reproduceable code
below, both with the normal 0-6 scale and the desired 3-6 scale (with bars
removed). How can I get the graph to have the desired 3-6 scale without
removing the bars. Thanks!
#Data
2010 Mar 12
1
simple plot in ggplot2, wrong error bars
I was wondering if anyone could help me with this, simple problem.
I am essentially following the example on Hadley's webpage
(http://had.co.nz/ggplot2/geom_errorbar.html), but it still doesn't make any
sense to me.
df <- data.frame(trt = factor(c("intact", "intact", "removed", "removed")),
coon = c(0.093, 0.06, 0.057, 0.09), group =
2010 Aug 04
2
ggplot2 barplot: extra markers in graph
Dear List,
(self-contained example + version info at the bottom)
I'm having trouble producing a barplot using the functions in ggplot2. When I use the position="dodge" option, the bars are plotted but also a number of spurious markers. More specifically, a number of black dots are plotted in the graph that should not be there. This behaviour is not seen when calling the same
2012 Mar 12
1
ggplot2: coord_polar
Hello HelpeRs,
The last print statement in the code segment below results in :
Error in data$x[data$x == -Inf] <- range$x.range[1] :
replacement has length zero
R version 2.14.1 Patched (2011-12-23 r57982)
ggplot2: version 0.90
OS : Linux (64bit)
Any thoughts?
Many Thanks,
A.
## code segment starts here
df <- data.frame(
trt = factor(c(1, 1, 2, 2)),
resp = c(1, 5,
2007 Oct 14
1
ggplot2: ordering categorial data
Hello again,
everytime I think I got something to work, the next issue comes up...
I have the following data.frame, I want to visualize:
> data_rb
tld spam1 spam2 share
1 ca 826436 73452 0.0889
2 org 470550 25740 0.0547
3 de 156042 15531 0.0995
4 com 140753 7527 0.0535
5 edu 34845 2507 0.0719
6 net 12781 382 0.0299
7 ru 7648 18 0.0024
2010 Aug 11
2
help to polish plot in ggplot2
Hi,
I wanted to generate a plot which is almost like the plot generated by the
following codes.
category <- paste("Geographical Category", 1:10)
grp1 <- rnorm(10, mean=10, sd=10)
grp2 <- rnorm(10, mean=20, sd=10)
grp3 <- rnorm(10, mean=15, sd=10)
grp4 <- rnorm(10, mean=12, sd=10)
mydat <- data.frame(category,grp1,grp2,grp3,grp4)
dat.m <- melt(mydat)
p <-
2009 Oct 14
1
change order of bar plot categories
Is this what you want?
temp<-c(rep("Low",2),rep("Medium",2),rep("High",2))
light<-rep(c("Dark","light"),3)
avg<-dat.avg2[,3] #
se<-dat.avg2[,4]
dat.avg.temp<-data.frame(cbind(avg,se))
dat.avg.temp<-data.frame(cbind(temp,light,dat.avg.temp))
dat.plot<-qplot(light,avg, fill=factor(temp),data=dat.avg.temp,
geom="bar",
2010 Apr 07
1
ggplot2, density barplot and geom_point layer
Hi,
Please consider the example below. How can I manage to overlay the points
the way I want in the second case?
Thanks, Joh
library(ggplot2)
# Modify data to match "real" case
myDiamonds <- diamonds
myDiamonds[["clarity"]] <- as.character(myDiamonds[["clarity"]])
myDiamonds[myDiamonds[["clarity"]]=="I1","clarity"] <- 1
2009 Sep 11
1
bar chart with means - using ggplot
Like this?
# example using qplot
library(ggplot2)
meanprice <- tapply(diamonds$price, diamonds$cut, mean);meanprice
cut <- factor(levels(diamonds$cut), levels = levels(diamonds$cut))
qplot(cut, meanprice, geom="bar", stat="identity", fill = I("grey50"))
dev.new() # create a new graph to compare with qplot
# Example using ggplot
ggdata <-
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) +
2009 Feb 18
1
ggplot2 Y axis labels
Hi all:
Using the example below, is there a way to add Y axis titles to each graphic instead of sharing the same title?
library(ggplot2)
RT = matrix(c(814, 500, 424, 394, 967, 574, 472, 446),4,2)
colnames(RT) = c('repetition','alternation')
rownames(RT) = c('7-yrs','11-yrs','15-yrs','21-yrs')
rt <- melt(RT)
names(rt) <- c("age",
2007 Oct 21
2
scatter plot with 1 standard deviation for each point
Hi,
Could anyone give suggestions how to plot a scatter plot with 1 standard
deviation for each point. To make it clearer, here is a simple example: the
scatterplot is plot(X, Y), but I want to add 1 standard deviation according
to the value of Z for each Y.
X Y Z
1 3.5 1.1
. . .
. . .
. . .
Thanks a lot in advance.
FD
[[alternative HTML
2008 Feb 06
1
Histogram/Bar plot graph
Hi,
I have the following data:
> Myvalues
Gene ES MEF Embryo ESHyp
1 GeneA -0.38509507 0.00 1.6250 1.7039921
2 GeneB 0.06262914 0.00 1.6250 -0.272033
and so on...
I want to plot the expression values of GeneA and GeneB in the
different cell/embryo/conditions (columns 2:5 above). Now, if I do:
>library(ggplot2)
> qplot(x=Gene, Embryo, geom =
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!
2011 Sep 29
1
How to Code Random Nested Variables within Two-way Fixed Model in lmer or lme
Hi All,
I am frustrated by mixed-effects model! I have searched the web for
hours, and found lots on the nested anova, but nothing useful on my
specific case, which is: a random factor (C) is nested within one of the
fixed-factors (A), and a second fixed factor (B) is crossed with the
first fixed factor:
C/A
A
B
A x B
My question: I have a functioning model using the aov command (see
2012 Jul 07
4
replacement has length zero
I have been working on the following code but keep getting an err message. My
current thinking is that the problem is on the indexing but do not know how
to fix it. Any help please?
ungulate <- read.csv("Ungulate.csv",row.names=1)
ungulate <-
as.matrix(ungulate);colnames(ungulate)<-NULL;rownames(ungulate)<-NULL
habitat <- read.csv("Ungulate_vegetation.csv")
2006 Jun 08
2
nested mixed-effect model: variance components
Dear listers,
I am trying to assess variance components for a nested, mixed-effects
model. I think I got an answer that make sense from R, but I have a
warning message and I wanted to check that what I am looking at is
actually what I need:
my data are organized as transects within stations, stations within
habitats, habitats within lagoons.
lagoons: random, habitats: fixed
the question is:
2002 Jul 11
2
Nested anovas in R not doing what they ought to...
Hi, there
I first sent this e-mail a couple months ago, to no avail.Since I am not a member on your mailing list, so could you please cc: a response to me? I'll be sure to check the list today for replies.
I am currently attempting to perform an ANOVA with both nested and normal factors. My problem is that R is treating my nested factors the exact same way as it would interaction terms.