Remigijus Lapinskas wrote:
Many thanks to all who replied to my e-mail. My problem was that I
had not known about the approx function.

By the way, if I have  x <- c(1990,1994,1995,1997), is there an
automated way to fill in the gaps, i.e., to get
c(1991,1992,1993,1996)?

Try this:

R> x <- c(1990, 1994, 1995, 1997)
R> all.x <- seq(min(x), max(x))
R> missing.x <- all.x[!all.x %in% x]
R> missing.x
[1] 1991 1992 1993 1996
R>

Regards,
Sundar

______________________________________________
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to