Skip to content
Back to formatted view

Raw Message

Message-ID: <8D0FD9CD-6D0B-43F5-836E-F963D3932222@noaa.gov>
Date: 2009-01-10T16:48:59Z
From: Roy Mendelssohn - NOAA Federal
Subject: Plot link points
In-Reply-To: <49686F06.2040208@bitwrit.com.au>

Look at:

http://geography.uoregon.edu/geogr/topics/maps.htm

-Roy

On Jan 10, 2009, at 1:48 AM, Jim Lemon wrote:

> Kitty Lee wrote:
>> Hi. This may be a straight-forward question...
>>
>> I have a time series from 1950 to 2000 (by year) with missing values.
>> Sometimes only a year has value and the adjacent years have missing  
>> data, e.g.
>>
>> 1950 2.7
>> 1951 1952
>> 1953 3.4
>> 1954
>> 1955
>> 1956 2.9
>> 1957 3.6
>> 1958 2.7
>>
>>
>> When I use plot (type='l'), the line can't connect the 'stand- 
>> alone' years. Is there a way I have have R to skip over the NA and  
>> draw a line with the points available?
>>
>>
> Hi Kitty,
> Assuming that the above is a data frame with two columns, the second  
> of which is named "value":
>
> plot(my.data.frame[!is.na(my.data.frame$value),],type="l")
>
> Jim
>
> ______________________________________________
> R-help at 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.

**********************
"The contents of this message do not reflect any position of the U.S.  
Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

e-mail: Roy.Mendelssohn at noaa.gov (Note new e-mail address)
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected"