[R] create waveform sawtooth

mail me mailme842 at googlemail.com
Mon Mar 26 16:18:03 CEST 2012


Hi:

I am trying to create a sawtooth waveform. I used the following

x <- runif(500, min = -2, max = 2)
y <- (1 -abs(x3))* ((x3) <= 1)
combined <- data.frame(x = x3, y = y3)
plot(combined)

and I get a triangular waveform, not sawtooth. Can someone give a
solution to create a sawtooth waveform?

Thanks
deb



More information about the R-help mailing list