An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090218/90bf7af9/attachment-0001.pl>
error bars
8 messages · Nicole Hackman, Michael Lawrence, jdeisenberg +5 more
Check out ggplot2: http://had.co.nz/ggplot2/ Particularly: http://had.co.nz/ggplot2/geom_errorbar.html If you need more help you'll have to provide a self-contained set of data/code. Hopefully you'll soon be completely rid of this strange "excel" of which you speak :Op On Wed, Feb 18, 2009 at 9:38 PM, Nicole Hackman
<nicole.hackman at gmail.com> wrote:
Hello, I have a very simple data set i imported from excel including 96
averages in a column along with 96 standard errors associated with those
averages (calculated in excel). I plotted the 95 averages using r and I am
wondering if it is possible to plot the second column of standard errors
while applying error bars to each value so they represent the error
corresponding to each average?
thanks,
Nicole
--
Nicole Hackman
Master of Science Student
University of Washington
College of Forest Resources
Box 352100
nh8 at u.washington.edu
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Mike Lawrence Graduate Student Department of Psychology Dalhousie University www.thatmike.com Looking to arrange a meeting? Check my public calendar: http://www.thatmike.com/mikes-public-calendar ~ Certainty is folly... I think. ~
Nicole Hackman wrote:
Hello, I have a very simple data set i imported from excel including 96 averages in a column along with 96 standard errors associated with those averages (calculated in excel). I plotted the 95 averages using r and I am wondering if it is possible to plot the second column of standard errors while applying error bars to each value so they represent the error corresponding to each average?
You might also find http://users.fmg.uva.nl/rgrasman/rpages/2005/09/error-bars-in-plots.html this page to be useful; it doesn't require you to load any new packages.
View this message in context: http://www.nabble.com/error-bars-tp22092367p22095134.html Sent from the R help mailing list archive at Nabble.com.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090219/e4f3b74f/attachment-0001.pl>
Hi Chun,
I did do the research and work on for hours ... I try to creat a new variable in my dataset.
Yes, looks like you did. Look at ?interaction, which gives you more
flexibility than ?":".
## Example
diet<-sort(rep(x=c("C","T"),4))
vesl<-rep(x=c("A","P"),4)
mydata<-data.frame(diet,vesl)
mydata$trt <- interaction(mydata$diet, mydata$vesl)
mydata
mydata$trt <- mydata$diet:mydata$vesl
mydata
Regards, Mark.
Chun-Hao Tu wrote:
Hi R users, I did do the research and work on for hours, but I still don't know how to solve my silly problem. I try to creat a new variable in my dataset. such as if diet=="C" && vesl=="P" then trt="CP"; if diet=="C" && vesl=="A" then trt="CA";..... The following is my code (It does not work correctly). Could anyone give me a hint? Appreciate!
diet<-sort(rep(x=c("C","T"),4))
vesl<-rep(x=c("A","P"),4)
mydata<-data.frame(diet,vesl)
mydata$trt<-ifelse(mydata$diet=="C" && mydata$vesl=="A", "CA",
+ ifelse(mydata$diet=="C" && mydata$vesl=="P", "CP", + ifelse(mydata$diet=="T" && mydata$vesl=="A", "TA", + ifelse(mydata$diet=="T" && mydata$vesl=="P", "TP"))))
mydata
diet vesl trt 1 C A CA 2 C P CA 3 C A CA 4 C P CA 5 T A CA 6 T P CA 7 T A CA 8 T P CA Thank you very much Chunhao
_________________________________________________________________ [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
View this message in context: http://www.nabble.com/error-bars-tp22092367p22096172.html Sent from the R help mailing list archive at Nabble.com.
On Thu, Feb 19, 2009 at 1:19 AM, jdeisenberg <catcode at catcode.com> wrote:
Nicole Hackman wrote:
Hello, I have a very simple data set i imported from excel including 96 averages in a column along with 96 standard errors associated with those averages (calculated in excel). I plotted the 95 averages using r and I am wondering if it is possible to plot the second column of standard errors while applying error bars to each value so they represent the error corresponding to each average?
You might also find http://users.fmg.uva.nl/rgrasman/rpages/2005/09/error-bars-in-plots.html this page to be useful; it doesn't require you to load any new packages.
On the other hand, it's a fundamentally limited approach. With a small investment in learning ggplot2, you can easily add error bars to absolutely any type of graphic. Hadley
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090219/e5c990a6/attachment-0001.pl>
On Thu, Feb 19, 2009 at 9:50 AM, Jorge Ivan Velez
<jorgeivanvelez at gmail.com> wrote:
mydata$trt<-with(mydata,paste(diet,vesl,sep=""))
Besides the above (good!) solution, you might want to understand why your original solution didn't work:
mydata$trt<-ifelse(mydata$diet=="C" && mydata$vesl=="A", "CA",
+ ifelse(mydata$diet=="C" && mydata$vesl=="P", "CP", + ifelse(mydata$diet=="T" && mydata$vesl=="A", "TA", + ifelse(mydata$diet=="T" && mydata$vesl=="P", "TP"))))
The problem here is that you are using && rather than &. From the man page:
'&' and '&&' indicate logical AND and '|' and '||' indicate
logical OR. The shorter form performs elementwise comparisons in
much the same way as arithmetic operators. The longer form
evaluates left to right examining only the first element of each
vector.
I trust this makes things clearer.
-s