[R] ploting missing data
Markus Schmidberger
schmidb at ibe.med.uni-muenchen.de
Fri Sep 7 16:35:56 CEST 2007
Hello,
I have this kind of dataframe and have to plot it.
data <- data.frame(sw= c(1,2,3,4,5,6,7,8,9,10,11,12,15),
zehn =
c(33.44,20.67,18.20,18.19,17.89,19.65,20.05,19.87,20.55,22.53,NA,NA,NA),
zwanzig =
c(61.42,NA,26.60,23.28,NA,24.90,24.47,24.53,26.41,28.26,NA,29.80,35.49),
fuenfzig =
c(162.51,66.08,49.55,43.40,NA,37.77,35.53,36.46,37.25,37.66,NA,42.29,47.80)
)
The plot should have lines:
lines(fuenfzig~sw, data=data)
lines(zwanzig~sw, data=data)
But now I have holes in my lines for the missing values (NA). How to
plot the lines without the holes?
The missing values should be interpolated or the left and right point
directly connected. The function approx interpolates the whole dataset.
Thats not my goal!
Is there no plotting function to do this directly?
Best
Markus
--
Dipl.-Tech. Math. Markus Schmidberger
Ludwig-Maximilians-Universität München
IBE - Institut für medizinische Informationsverarbeitung,
Biometrie und Epidemiologie
Marchioninistr. 15, D-81377 Muenchen
URL: http://ibe.web.med.uni-muenchen.de
Mail: Markus.Schmidberger [at] ibe.med.uni-muenchen.de
More information about the R-help
mailing list