Re: [R] Error Bar Issues

From: Joris Meys <jorismeys_at_gmail.com>
Date: Sun, 06 Jun 2010 12:47:27 +0200

On Sun, Jun 6, 2010 at 12:51 AM, beloitstudent <schurrk_at_beloit.edu> wrote:
>
> Thanks for the suggestion...but R still doesn't like it.  Now I have 3 error
> messages.  It seems to dislike my *err=y* command.  I'm going to continue
> trying.  Thanks for your help!  If you happen to spot anything else, please
> let me know!
Off course, same problem: You're referring to an object y in your command. But you have no object named y in your workspace, so R can't continue.

Look at the help files:
?plotCI

You'll see you have to put quotation marks around y, like William showed you. Next to that, please also define from which package you use a plot. plotCI can be found in the gplots package and in the plotrix package.

Cheers
Joris

Either you define all input for the function before you run it, or you use the double quotes like William showed
>
> thanks!
> beloitstudent
>
>
> On Sat, Jun 5, 2010 at 5:16 PM, Joris FA Meys [via R] <
> ml-node+2244611-1554261936-278019_at_n4.nabble.com<ml-node%2B2244611-1554261936-278019_at_n4.nabble.com>
>> wrote:
>
>> you can't refer to an argument within a function call. Try
>>
>> uiw <- Saline[,3]
>>
>> plotCI(x=Saline [,1],y=Saline [,2], uiw=uiw, liw=uiw, err=y, pch=21,
>> pt.bg=par("bg"), cex=1.5, lty=1, type="o", gap=0, sfrac=0.005,
>> xlim=c(-21,340),xaxp=c(-20,320,11), xlab="Time (min)", ylim=c(0,12),
>> yaxp=c(0,12,11), ylab="Arterial Plasma Acetaminophen (µg/mL)", las=1,
>> font.lab=2, add=TRUE)
>>
>> Cheers
>> Joris
>>
>> On Sat, Jun 5, 2010 at 6:09 PM, beloitstudent <[hidden email]<http://user/SendEmail.jtp?type=node&node=2244611&i=0>>
>> wrote:
>>
>> >
>> > Hello all,
>> >
>> > I am an undergraduate student who is having syntax issues trying to get
>> > error bars on my graph.
>> >
>> > This is the data, which I assigned the name "Saline" to.
>> >  Time       Average       SEM
>> > 1   -20      0.000000     0.0000000
>> > 2
>> > 3    30      0.000000     0.0000000
>> > 4    45      3.227902     0.7462524
>> > 5    60      5.066664     1.1623944
>> > 6    80      6.107491     1.5027762
>> > 7   110     6.968231     1.3799637
>> > 8   140     7.325713     1.2282053
>> > 9   200     7.875194     1.1185175
>> > 10  260    6.513927     0.5386359
>> > 11  320    4.204342     0.6855906
>> >
>> > This is the command that I typed in to get my error bars.
>> >
>> > plotCI(x=Saline [,1],y=Saline [,2], uiw=Saline [,3], liw=uiw, err=y,
>> pch=21,
>> > pt.bg=par("bg"), cex=1.5, lty=1, type="o", gap=0, sfrac=0.005,
>> > xlim=c(-21,340),xaxp=c(-20,320,11), xlab="Time (min)", ylim=c(0,12),
>> > yaxp=c(0,12,11), ylab="Arterial Plasma Acetaminophen (µg/mL)", las=1,
>> > font.lab=2, add=TRUE)
>> >
>> > And this is the error message I keep getting
>> > Error in plotCI(x = Saline[, 1], y = Saline[, 2], uiw = Saline[, 3], liw
>> =
>> > uiw,  :
>> >  object 'uiw' not found
>> > In addition: Warning message:
>> > In if (err == "y") z <- y else z <- x :
>> >  the condition has length > 1 and only the first element will be used
>> >
>> > Now, to me, the command seems correct.
>> > I want the error bars to show up where the points on my graph are...so
>> the x
>> > coordinates should be my time (aka Saline [1]) and the y coordinates
>> should
>> > be my Averages (aka Saline [2])  and my upper and lower limits to my
>> > confidence interval should be the SEM from Saline [3], but something is
>> > wrong with this and I cannot figure out what it is.  If anyone has
>> > suggestions I would be very grateful.  Thanks for your help!
>> >
>> > beloitstudent
>> > --
>> > View this message in context:
>> http://r.789695.n4.nabble.com/Error-Bar-Issues-tp2244335p2244335.html
>> > Sent from the R help mailing list archive at Nabble.com.
>> >
>> > ______________________________________________
>> > [hidden email] <http://user/SendEmail.jtp?type=node&node=2244611&i=1>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.
>> >
>>
>>
>>
>> --
>> Ghent University
>> Faculty of Bioscience Engineering
>> Department of Applied mathematics, biometrics and process control
>>
>> tel : +32 9 264 59 87
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=2244611&i=2>
>> -------------------------------
>> Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php
>>
>> ______________________________________________
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=2244611&i=3>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 message @
>> http://r.789695.n4.nabble.com/Error-Bar-Issues-tp2244335p2244611.html
>> To unsubscribe from Error Bar Issues, click here< (link removed) ==>.
>>
>>
>>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Error-Bar-Issues-tp2244335p2244627.html
> Sent from the R help mailing list archive at Nabble.com.
>
>        [[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.
>
>

-- 
Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

tel : +32 9 264 59 87
Joris.Meys_at_Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

______________________________________________
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.
Received on Sun 06 Jun 2010 - 10:49:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 06 Jun 2010 - 11:20:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive