[R] loess and NA

Filoche pmassicotte at hotmail.com
Tue Oct 5 17:11:34 CEST 2010


Hi everyone.

I'm trying to do a loess with missing value on independant variable.



doc = c(2.27904, 2.59536, 7.44696, NA, 6.24264, 4.58400, 5.79192, 5.39502,
7.41216, 4.09440, 4.22868, 4.24620, 5.43804, 1.95528);
distance = c(26.5,56.5, 90.3, 123.0, 147.5, 176.0, 215.7, 229.3, 252.0,
325.3, 362.0, 419.3, 454.6, 470.0);

myloess = loess(doc ~ distance, na.action = na.omit);

plot(distance, predict(myloess));

When I plot the data there's a problem since distance and predicted values
have different length.

Any way to plot the loess without having to specify the X data?

With regards,
Phil 



-- 
View this message in context: http://r.789695.n4.nabble.com/loess-and-NA-tp2956235p2956235.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list