Re: [R] How to plot this simple step function?

2013-01-17 Thread Bornin1992
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)]) :

[R] How to plot this simple step function?

2013-01-16 Thread Bornin1992
Hi everyone, I am trying to graph a step function in R Studio. I just learned about R today and decided to try it! The following is what I want it to look like. I graphed it using x <- 0:5 y <- c(0, .2, .3, .6, .9, 1.0) plot(x, y, type = "s") And used Microsoft Paint to get it to how I wante