Re: [R] Polar graph of time and tide

2007-05-02 Thread Gabor Grothendieck
On 5/2/07, Jim Lemon <[EMAIL PROTECTED]> wrote:
> Alan E. Davis wrote:
> > I have been trying to visualize times of lowest tides, month by month.
> >  I have tide predictions with times either in unix time or a text
> > format, and heights in feet or meters.  I had been able to derive the
> > clock times of each prediction.   I would now like to graph this data
> > with points showing heights as "r" and times as "theta", from  to
> > 2355.  There is a seasonal component: I am interested in displaying
> > times of lowest tides in particular.
> >
> > I am sure this is so simple as to burden those on the list; I however
> > have spent two evenings trying to figure out how to use polar.plot,
> > and I'm not sure that's the best way to do this.  May I request some
> > advice?  The docs with polar.plot are not complete, I fear.
> >
> > Thank you, begging for your indulgence,
> >
> Hi Alan,
> Earl Glynn's advice is spot-on if you are trying to map tides onto the
> diurnal cycle. However, I get the impression that you want an annual
> cycle. If this is the case, it is probably best to go to the underlying
> function, radial.plot. Here is an example with some imaginary tides.
>
> lowtide<-sin(seq(1:12)+sin(seq(1,24,by=2)/10))
> lowtide<-rescale(lowtide,c(0,2355))
> month.abbr<-c("jan","Feb","Mar","Apr","May","Jun",
>  "Jul","Aug","Sep","Oct","Nov","Dec")


> radial.plot(lowtide,labels=month.abbr,rp.type="s")

Note that month.abb is built into R so one could eliminate the
month.abbr<- line and write:

radial.plot(lowtide, labels = month.abb, rp.type = "s")

__
R-help@stat.math.ethz.ch 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.


Re: [R] Polar graph of time and tide

2007-05-02 Thread Jim Lemon
Alan E. Davis wrote:
> I have been trying to visualize times of lowest tides, month by month.
>  I have tide predictions with times either in unix time or a text
> format, and heights in feet or meters.  I had been able to derive the
> clock times of each prediction.   I would now like to graph this data
> with points showing heights as "r" and times as "theta", from  to
> 2355.  There is a seasonal component: I am interested in displaying
> times of lowest tides in particular.
> 
> I am sure this is so simple as to burden those on the list; I however
> have spent two evenings trying to figure out how to use polar.plot,
> and I'm not sure that's the best way to do this.  May I request some
> advice?  The docs with polar.plot are not complete, I fear.
> 
> Thank you, begging for your indulgence,
> 
Hi Alan,
Earl Glynn's advice is spot-on if you are trying to map tides onto the 
diurnal cycle. However, I get the impression that you want an annual 
cycle. If this is the case, it is probably best to go to the underlying 
function, radial.plot. Here is an example with some imaginary tides.

lowtide<-sin(seq(1:12)+sin(seq(1,24,by=2)/10))
lowtide<-rescale(lowtide,c(0,2355))
month.abbr<-c("jan","Feb","Mar","Apr","May","Jun",
  "Jul","Aug","Sep","Oct","Nov","Dec")
radial.plot(lowtide,labels=month.abbr,rp.type="s")

This plots time of lowest tide in a month as a symbol at a radial 
distance proportional to the 24 hour time of day. As you can see from 
running the example, the months of the year are displayed around the 
circumference of the plot. One annoyance is that the hours are displayed 
as 0-2500. As "pretty" handles that, you would have to set 
show.radial.grid to FALSE and manually draw the desired grid (a pain, 
but not impossible).

You could also place the symbols at the position in the month of the 
lowest tide by specifying radial.pos instead of letting the function 
spread them out evenly.

If you want to overlay a number of years, x should be a matrix and 
point.col can be chosen so that each year has a different color.

I would like to know of any deficiencies in the docs, as while I think I 
know what I'm talking about, it is you out there who have to understand it.

Jim

__
R-help@stat.math.ethz.ch 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.


Re: [R] Polar graph of time and tide

2007-05-01 Thread Earl F. Glynn
"Alan E. Davis" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I have been trying to visualize times of lowest tides, month by month.
> I have tide predictions with times either in unix time or a text
> format, and heights in feet or meters.  I had been able to derive the
> clock times of each prediction.   I would now like to graph this data
> with points showing heights as "r" and times as "theta", from  to
> 2355.  There is a seasonal component: I am interested in displaying
> times of lowest tides in particular.

Does this get you started?


library(plotrix)

theta <- seq(0, 23.5, by=0.5)
r <- runif(length(theta), 5, 10)

clock24.plot(r, theta, main="Polar Plot")

or

clock24.plot(r, theta, main="Polar Plot", rp.type="p")


efg
Stowers Institute for Medical Research

__
R-help@stat.math.ethz.ch 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] Polar graph of time and tide

2007-05-01 Thread Alan E. Davis
I have been trying to visualize times of lowest tides, month by month.
 I have tide predictions with times either in unix time or a text
format, and heights in feet or meters.  I had been able to derive the
clock times of each prediction.   I would now like to graph this data
with points showing heights as "r" and times as "theta", from  to
2355.  There is a seasonal component: I am interested in displaying
times of lowest tides in particular.

I am sure this is so simple as to burden those on the list; I however
have spent two evenings trying to figure out how to use polar.plot,
and I'm not sure that's the best way to do this.  May I request some
advice?  The docs with polar.plot are not complete, I fear.

Thank you, begging for your indulgence,

Alan

-- 
Alan Davis, Kagman High School, Saipan  [EMAIL PROTECTED]


Every great advance in natural knowledge has involved the absolute
rejection of authority.  - Thomas H. Huxley

__
R-help@stat.math.ethz.ch 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.