Works also for me.
sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C
[3] LC_TIME=fr_FR.UTF-8LC_COLLATE=fr_FR.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=fr_FR.UTF-8
[7]
Hi
Don't use t as var names, because t is also a function (transpose).
This code should work...
set.seed(1)
T - rnorm(500)
qplot(T, geom = blank) +
geom_histogram(aes(y = ..density..), colour = black, fill = blue) +
stat_density(geom = line, colour = red)
--
View this message in context:
my badyou are right
I always use TRUE instead of T, so i forgot that by default T = TRUE in R.
--
View this message in context:
http://r.789695.n4.nabble.com/ggplot-2-Histogram-with-bell-curve-tp3580359p3581032.html
Sent from the R help mailing list archive at Nabble.com.
Hi robert,
It's not a typo, i have the book and the right code is :
huron - data.frame(year=1875:1972,level=LakeHuron)
p - ggplot(huron, aes(year)) +
geom_line(aes(y= level - 5, colour = 'blue')) +
geom_line(aes(y= level + 5, colour = 'red'))
print(p)
So colour must inside aes
--
May be this problem is OS specific (mac OS or windows...) i use ubuntu and
have no problem with this function
R packageVersion(base)
[1] ‘2.12.1’
R packageVersion('lme4')
[1] ‘0.999375.37’
R sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1]
5 matches
Mail list logo