[R] continuous lines?

John Fox jfox at mcmaster.ca
Sun Nov 3 23:37:59 CET 2002


Dear Richard,

At 08:28 PM 11/3/2002 +0100, Richard =?iso-8859-15?q?M=FCller?= wrote:

>I can't manage to plot continous lines (x-y representation of measured data):
>The spreadsheet where the data come from has continuous x-data (0,1,2,3,4,
>...), but not every x-datum has a corresponding y-datum. At these "gaps" the
>graph is not displayed. I want to display the measured data with points,
>joined by a line ("type=b"), even if there are gaps. Is that possible?

You could filter the missing data -- for example,

         plot(na.omit(data.frame(x, y)), type='b')

(where x and y are the variables that you want to plot).

I hope that this helps,
  John

-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list