Try this:

> resid(lm(tt~year, na.action = na.exclude))
         1          2          3          4          5          6          7
 0.7114894  1.2231383  0.1447872 -1.8035638 -0.8519149 -0.5302660         NA
         8          9         10
        NA         NA  1.1063298


On Dec 3, 2007 10:31 AM, rem la <[EMAIL PROTECTED]> wrote:
> Dear All,
>
> I have two vectors:
>
> tt = c(6.87, 7.43, 6.4, 4.5, 5.5, 5.87, NA, NA, NA, 7.7)
> year = 1966:1975
>
> Residuals
>
> lm(tt~year)$res
>
> do not contain NAs for the three years of missing temperature tt. Is there a
> simple way to get these NAs back into the residual's vector?
>
> Thank you,
> Sorama
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> 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.
>

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to