[R] [FORGED] Plot step function

Bert Gunter bgunter.4567 at gmail.com
Sat Feb 6 20:57:49 CET 2016


All of which should suggest:

1. Before posting further, spend some time with an R tutorial or two.
"An Intro to R" ships with R; and links to some of the many excellent
web resources can be found here:

https://www.rstudio.com/resources/training/online-learning/#R


2. Search!  A web search of "plot step function in R"  would have
brought up stepfun() and other relevant links. rseek.org or the sos
package  -- or even the RSiteSearch() function -- are other ways to
find about R and R package functionality. See also the CRAN task view
pages.

Typically, answers to basic questions like the OP's can be found more
quickly and easily through such means; and with the added benefit of
providing examples and connections to related material. Of course, if
**after** consulting such resources questions still remain, asking
here is usually helpful.


Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sat, Feb 6, 2016 at 10:29 AM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
> On 07/02/16 01:11, jupiter wrote:
>>
>> Hi,
>>
>> I am just starting to learn R, sorry for asking a simple question. How can
>> plot a line x <= 0 y = 0, x > 0 y = 1?
>
>
> One way:
>
>     plot(c(-1,0,1),c(0,1,1),type="s",xlab="x",ylab="y")
>
> cheers,
>
> Rolf Turner
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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