On 2016-02-06 19:23, David Winsemius wrote:
On Feb 6, 2016, at 4:11 AM, 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?
There is a stepfun function and an associated plotting method:
y0 <- c(rep(0,3),re
> On Feb 6, 2016, at 4:11 AM, 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?
There is a stepfun function and an associated plotting method:
y0 <- c(rep(0,3),rep(1,3))
sfun0 <- stepfun(-2:2, y0,
On 06/02/2016 7:11 AM, 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?
There are lots of ways. One is
curve(ifelse(x < 0, 0, 1), from=-2, to=2)
This isn't perfectly vertical at x=0; a more accurate approac
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?
Thank you.
- j
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
htt
4 matches
Mail list logo