[R] How to plot this simple step function?

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Thu Jan 17 10:21:15 CET 2013


you forgot to define the x and y variables that you provided as examples.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Bornin1992 <ian at mcparland.ca> wrote:

>Thank you for your reply!
>
>When I copy and paste the code into the Console, I receive several
>errors!
>
>
>
>
>1) Error in plot(x, y, type = "n") : object 'x' not found
>> segments(x[-length(x)],y[-length(x)],x[-1],y[-length(x)])
>Error in segments(x[-length(x)], y[-length(x)], x[-1], y[-length(x)]) :
>
>  object 'x' not found
>2)Error in points(x[-length(x)], y[-length(x)], pch = 16) : 
>  object 'x' not found
>points(x[-1],y[-length(x)],pch=1) 
>3) Error in points(x[-1], y[-length(x)], pch = 1) : object 'x' not
>found.
>
>What am I doing wrong? :'(
>
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/How-to-plot-this-simple-step-function-tp4655792p4655813.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>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.



More information about the R-help mailing list