Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Richard O'Keefe
I think we all figured out what TMIN and TMAX were.
That's *precisely* why there is a problem.
The "average or median" daily maxima mean practically
nothing.
Let's take where I live, for example.
I'm looking at an official map.  I see temperatures
7.3C, 9.8C, 14C, 14.2C, 14.7C, and 15C.  According to what
is supposed to be the same source on my phone, it's 12C.
All for the same time, and all within a few kilometres.
The temperature that is recorded in the national data set
is taken at the local airport, about 30km away, and generally
about 2 or 3C hotter than other measurements.  (Airport
weather stations notoriously run hot.)  The local weather
station I trust most, run by the Physics department at the
University, says that today's maximum was 20C, but if it
went any higher than 17C where I live (10 minutes away by
car) I shall be very much surprised.

What explains all this?
(1) Altitude.  We're not unusually hilly, but the variation
with altitude is much more than you'd expect from the usual
adiabatic lapse rate.
(2) Proximity to the coast and sea breezes.
(3) Which side of a hill/valley you're on.
(4) Variation in solar irradiance, which is *astonishingly*
patchy (even after averaging out clouds).
Weather is just unspfxably variable.
Don't look at extremes if you can look at distributions.

And all this means that unless you fit some kind of predictive model
that takes into account things like expected cloud cover for the
duration of your stay, the data you have are going to be a much
cruder guide than you can expect.  Your best guide is probably
"how do the people who live there dress at this time of year"?

Oh, for what it's worth, here are daily TMAX values for this
time of year a couple of years ago.
 10.9 14.2 14.3 19.4 21.3 18.1 18.4 16.0 13.1 13.3 15.4 17.6 20.3 18.2 14.8
17.0 17.2 11.7  6.0 10.6
What does that tell you?  "Welcome to changeable SPRING!"
If you take the average, which happens to be 15.4, you'll miss the
fact that you need to be prepared for anything between 6C and 21C.
So you need winter wear and summer wear.  To cope with TMAX.

The big mistakes in statistics are generally not in programming but
in formulating the problem.  In your case, you're overthinking the
problem.  Just plot the raw (or in your case, pre-cooked) data.
Plot TMAX and TMIN and look at their range and how much they vary.
Taking means or medians will destroy information you need for your
purposes.  Take the mean of 15.4 and you'll completely fail to notice
the day that got above 21 and the day that never got above 6 and you'll
be wrongly dressed for both of them.



On Thu, 14 Sept 2023 at 05:22, Kevin Zembower  wrote:

> Tim, Richard, y'all are reading too much into this. I believe that TMAX
> is the high temperature of the day, and TMIN is the low. I'm trying to
> compute the average or median high and low temperatures for the data I
> have (2011 to present). I'm going on a trip to this area, and want to
> know how to pack.
>
> Thanks for your interest.
>
> -Kevin
>
> On Thu, 2023-09-14 at 03:07 +1200, Richard O'Keefe wrote:
> > I am well aware of the physiological implications
> > of temperature, and that is *why* I view recorded
> > TMIN and TMAX at a single point with an extremely
> > jaundiced eye.  TMAX at shoulder height has very
> > little relevance to an insect living in grass, for
> > example.  And if TMAX is sustained for one second,
> > that has very different consequences from if TMAX
> > is sustained for five minutes.  I can see the usefulness
> > of "proportion of day above Thi/below Tlo", but that
> > is quite different.
> >
> > OK, so my interest in weather data was mainly based
> > around water management: precipitation, evaporation,
> > herd and crop water needs, that kind of thing.  And
> > the first thing you learn from that experience is
> > that ANY kind of single-point summary is seriously
> > misleading.
> >
> > Let's end this digression.
> >
> >
> > On Thu, 14 Sept 2023 at 02:18, Ebert,Timothy Aaron 
> > wrote:
> > > I had the same question.
> > > However, I can partly answer the off-topic question. Min and max
> > > can be important as lower and upper development thresholds. Below
> > > the min no growth or development occur because reaction rates are
> > > too slow to enable such. Above max, temperatures are too hot.
> > > Protein function is impaired, and systems stop functioning. There
> > > is a considerable range between where systems shut down (but
> > > recover) and tissue death.
> > > In a simple form the growth and physiological stage of plants,
> > > insects, and many others, can be modeled as a function of
> > > temperature. These are often called growing degree day models (or
> > > some version of that). This is number of thermal units needed for
> > > the organism to develop to the next stage (e.g. instar for an
> > > insect, or fruit/flower formation for a plant). However, better
> > > accuracy is obtained if the model includes both min and max
> > > thresholds.
> > >
>

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
Dear Kevin,

You could try the National Weather Service. I can get "International Falls" and 
other locations, though Ely is not specifically listed. 

h**ps://www.weather.gov/wrh/climate?wfo=dlh
Replace the ** with tt and it should give the right link.

There is a menu.
Select your location,
Select a product (I selected temperature)
Select a year, and period of interest.
Select go.

If you scroll over the figure a popup with numbers appears.

The weather data in R is possible as well.
I would start by filtering the data to remove dates outside my range of 
interest. Then extract the date (say Day). Group_by the day and apply a max 
function to the grouped data. Then plot the result.

Tim

-Original Message-
From: Kevin Zembower  
Sent: Wednesday, September 13, 2023 3:26 PM
To: Ebert,Timothy Aaron ; Richard O'Keefe 
Cc: r-help@r-project.org
Subject: Re: [R] Help with plotting and date-times for climate data

[External Email]

Hi, Tim,

I actually did see this chart when I was doing some research, but rejected it 
because it was difficult to interpolate the graph for the three week period I 
was interested it. I didn't discover until just now that I could click on the 
labels on the x-axis to expand the graph.
Unfortunately, downloading the data from this site costs $95/month.

Also, I found the raw data (from the NWS, for free) and decided to exercise my 
R skills to see if I could produce the exact graph I wanted.

Thanks for taking the time to research this.

-Kevin

On Wed, 2023-09-13 at 18:21 +, Ebert,Timothy Aaron wrote:
> Hi Kevin,
>
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fweat
> herspark.com%2Fy%2F11610%2FAverage-Weather-in-Ely-Minnesota-United-Sta
> tes-Year-Round&data=05%7C01%7Ctebert%40ufl.edu%7C3c23bc8b4af14d747e2f0
> 8dbb48f37af%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C6383022994410
> 38779%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJB
> TiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CE%2FYdcJbtKhZZ6VeRlI
> 55gEfwy8m2i1yhO9iUgB%2BkUc%3D&reserved=0
> Just scroll down. I think what you are looking for is the first graph, 
> but there are about a dozen other graphs on various meteorological 
> metrics.
>
>Another option would be to use larger cities (Duluth, 
> International Falls, Thunder Bay) and take a metal average. There is a 
> lake effect for two of these more than the other.
>
>All good?
> Tim
>
> -Original Message-
> From: Kevin Zembower 
> Sent: Wednesday, September 13, 2023 2:05 PM
> To: Ebert,Timothy Aaron ; Richard O'Keefe 
> 
> Cc: r-help@r-project.org
> Subject: Re: [R] Help with plotting and date-times for climate data
>
> [External Email]
>
> Well, I looked for this, on both the NWS and WeatherUnderground, but 
> couldn't find what I was looking for. Didn't check Weather.com, but if 
> you can find a chart of the average high and low temperatures in Ely, 
> MN between about the middle of September to the middle of October, 
> I'll buy you a beer.
>
> -Kevin
>
> On Wed, 2023-09-13 at 17:39 +, Ebert,Timothy Aaron wrote:
> > I admire the dedication to R and data science, but the Weather 
> > Channel might be a simpler approach. Weather.com. I can search for 
> > (city
> > name)
> > and either weather (current values) or climate. It depends on how 
> > far away the trip will be.
> >
> > -Original Message-
> > From: Kevin Zembower 
> > Sent: Wednesday, September 13, 2023 1:22 PM
> > To: Richard O'Keefe ; Ebert,Timothy Aaron 
> > 
> > Cc: r-help@r-project.org
> > Subject: Re: [R] Help with plotting and date-times for climate data
> >
> > [External Email]
> >
> > Tim, Richard, y'all are reading too much into this. I believe that 
> > TMAX is the high temperature of the day, and TMIN is the low. I'm 
> > trying to compute the average or median high and low temperatures 
> > for the data I have (2011 to present). I'm going on a trip to this 
> > area, and want to know how to pack.
> >
> > Thanks for your interest.
> >
> > -Kevin
> >
> > On Thu, 2023-09-14 at 03:07 +1200, Richard O'Keefe wrote:
> > > I am well aware of the physiological implications of temperature, 
> > > and that is *why* I view recorded TMIN and TMAX at a single point 
> > > with an extremely jaundiced eye.  TMAX at shoulder height has very 
> > > little relevance to an insect living in grass, for example.  And 
> > > if TMAX is sustained for one second, that has very different 
> > > consequences from if TMAX is sustained for five minutes.  I can 
> > > see the usefulness of "proportion of day above Thi/below Tlo", but 
> > > that is quite different.
> > >
> > > OK, so my interest in weather data was mainly based around water
> > > management: precipitation, evaporation, herd and crop water needs, 
> > > that kind of thing.  And the first thing you learn from that 
> > > experience is that ANY kind of single-point summary is seriously 
> > > misleading.
> > >
> > > Let's end this digression.
> > >
> > >
> > > On Thu, 14 S

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Kevin Zembower via R-help
Hi, Tim,

I actually did see this chart when I was doing some research, but
rejected it because it was difficult to interpolate the graph for the
three week period I was interested it. I didn't discover until just now
that I could click on the labels on the x-axis to expand the graph.
Unfortunately, downloading the data from this site costs $95/month. 

Also, I found the raw data (from the NWS, for free) and decided to
exercise my R skills to see if I could produce the exact graph I
wanted.

Thanks for taking the time to research this.

-Kevin

On Wed, 2023-09-13 at 18:21 +, Ebert,Timothy Aaron wrote:
> Hi Kevin,
> 
> https://weatherspark.com/y/11610/Average-Weather-in-Ely-Minnesota-United-States-Year-Round
> Just scroll down. I think what you are looking for is the first
> graph, but there are about a dozen other graphs on various
> meteorological metrics. 
>    
>    Another option would be to use larger cities (Duluth,
> International Falls, Thunder Bay) and take a metal average. There is
> a lake effect for two of these more than the other. 
>    
>    All good?
> Tim
> 
> -Original Message-
> From: Kevin Zembower  
> Sent: Wednesday, September 13, 2023 2:05 PM
> To: Ebert,Timothy Aaron ; Richard O'Keefe
> 
> Cc: r-help@r-project.org
> Subject: Re: [R] Help with plotting and date-times for climate data
> 
> [External Email]
> 
> Well, I looked for this, on both the NWS and WeatherUnderground, but
> couldn't find what I was looking for. Didn't check Weather.com, but
> if you can find a chart of the average high and low temperatures in
> Ely, MN between about the middle of September to the middle of
> October, I'll buy you a beer.
> 
> -Kevin
> 
> On Wed, 2023-09-13 at 17:39 +, Ebert,Timothy Aaron wrote:
> > I admire the dedication to R and data science, but the Weather
> > Channel 
> > might be a simpler approach. Weather.com. I can search for (city
> > name) 
> > and either weather (current values) or climate. It depends on how
> > far 
> > away the trip will be.
> > 
> > -Original Message-
> > From: Kevin Zembower 
> > Sent: Wednesday, September 13, 2023 1:22 PM
> > To: Richard O'Keefe ; Ebert,Timothy Aaron 
> > 
> > Cc: r-help@r-project.org
> > Subject: Re: [R] Help with plotting and date-times for climate data
> > 
> > [External Email]
> > 
> > Tim, Richard, y'all are reading too much into this. I believe that 
> > TMAX is the high temperature of the day, and TMIN is the low. I'm 
> > trying to compute the average or median high and low temperatures
> > for 
> > the data I have (2011 to present). I'm going on a trip to this
> > area, 
> > and want to know how to pack.
> > 
> > Thanks for your interest.
> > 
> > -Kevin
> > 
> > On Thu, 2023-09-14 at 03:07 +1200, Richard O'Keefe wrote:
> > > I am well aware of the physiological implications of temperature,
> > > and that is *why* I view recorded TMIN and TMAX at a single point
> > > with an extremely jaundiced eye.  TMAX at shoulder height has
> > > very 
> > > little relevance to an insect living in grass, for example.  And
> > > if 
> > > TMAX is sustained for one second, that has very different 
> > > consequences from if TMAX is sustained for five minutes.  I can
> > > see 
> > > the usefulness of "proportion of day above Thi/below Tlo", but
> > > that 
> > > is quite different.
> > > 
> > > OK, so my interest in weather data was mainly based around water
> > > management: precipitation, evaporation, herd and crop water
> > > needs, 
> > > that kind of thing.  And the first thing you learn from that 
> > > experience is that ANY kind of single-point summary is seriously 
> > > misleading.
> > > 
> > > Let's end this digression.
> > > 
> > > 
> > > On Thu, 14 Sept 2023 at 02:18, Ebert,Timothy Aaron
> > > 
> > > wrote:
> > > > I had the same question.
> > > > However, I can partly answer the off-topic question. Min and
> > > > max 
> > > > can be important as lower and upper development thresholds.
> > > > Below 
> > > > the min no growth or development occur because reaction rates
> > > > are 
> > > > too slow to enable such. Above max, temperatures are too hot.
> > > > Protein function is impaired, and systems stop functioning.
> > > > There 
> > > > is a considerable range between where systems shut down (but
> > > > recover) and tissue death.
> > > > In a simple form the growth and physiological stage of plants, 
> > > > insects, and many others, can be modeled as a function of 
> > > > temperature. These are often called growing degree day models
> > > > (or 
> > > > some version of that). This is number of thermal units needed
> > > > for 
> > > > the organism to develop to the next stage (e.g. instar for an 
> > > > insect, or fruit/flower formation for a plant). However, better
> > > > accuracy is obtained if the model includes both min and max 
> > > > thresholds.
> > > > 
> > > > All I have done is provide an example where min and max could
> > > > have 
> > > > a real world use. I use max(temp) over

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
Hi Kevin,

https://weatherspark.com/y/11610/Average-Weather-in-Ely-Minnesota-United-States-Year-Round
Just scroll down. I think what you are looking for is the first graph, but 
there are about a dozen other graphs on various meteorological metrics. 
   
   Another option would be to use larger cities (Duluth, International 
Falls, Thunder Bay) and take a metal average. There is a lake effect for two of 
these more than the other. 
   
   All good?
Tim

-Original Message-
From: Kevin Zembower  
Sent: Wednesday, September 13, 2023 2:05 PM
To: Ebert,Timothy Aaron ; Richard O'Keefe 
Cc: r-help@r-project.org
Subject: Re: [R] Help with plotting and date-times for climate data

[External Email]

Well, I looked for this, on both the NWS and WeatherUnderground, but couldn't 
find what I was looking for. Didn't check Weather.com, but if you can find a 
chart of the average high and low temperatures in Ely, MN between about the 
middle of September to the middle of October, I'll buy you a beer.

-Kevin

On Wed, 2023-09-13 at 17:39 +, Ebert,Timothy Aaron wrote:
> I admire the dedication to R and data science, but the Weather Channel 
> might be a simpler approach. Weather.com. I can search for (city name) 
> and either weather (current values) or climate. It depends on how far 
> away the trip will be.
>
> -Original Message-
> From: Kevin Zembower 
> Sent: Wednesday, September 13, 2023 1:22 PM
> To: Richard O'Keefe ; Ebert,Timothy Aaron 
> 
> Cc: r-help@r-project.org
> Subject: Re: [R] Help with plotting and date-times for climate data
>
> [External Email]
>
> Tim, Richard, y'all are reading too much into this. I believe that 
> TMAX is the high temperature of the day, and TMIN is the low. I'm 
> trying to compute the average or median high and low temperatures for 
> the data I have (2011 to present). I'm going on a trip to this area, 
> and want to know how to pack.
>
> Thanks for your interest.
>
> -Kevin
>
> On Thu, 2023-09-14 at 03:07 +1200, Richard O'Keefe wrote:
> > I am well aware of the physiological implications of temperature, 
> > and that is *why* I view recorded TMIN and TMAX at a single point 
> > with an extremely jaundiced eye.  TMAX at shoulder height has very 
> > little relevance to an insect living in grass, for example.  And if 
> > TMAX is sustained for one second, that has very different 
> > consequences from if TMAX is sustained for five minutes.  I can see 
> > the usefulness of "proportion of day above Thi/below Tlo", but that 
> > is quite different.
> >
> > OK, so my interest in weather data was mainly based around water
> > management: precipitation, evaporation, herd and crop water needs, 
> > that kind of thing.  And the first thing you learn from that 
> > experience is that ANY kind of single-point summary is seriously 
> > misleading.
> >
> > Let's end this digression.
> >
> >
> > On Thu, 14 Sept 2023 at 02:18, Ebert,Timothy Aaron 
> > wrote:
> > > I had the same question.
> > > However, I can partly answer the off-topic question. Min and max 
> > > can be important as lower and upper development thresholds. Below 
> > > the min no growth or development occur because reaction rates are 
> > > too slow to enable such. Above max, temperatures are too hot.
> > > Protein function is impaired, and systems stop functioning. There 
> > > is a considerable range between where systems shut down (but
> > > recover) and tissue death.
> > > In a simple form the growth and physiological stage of plants, 
> > > insects, and many others, can be modeled as a function of 
> > > temperature. These are often called growing degree day models (or 
> > > some version of that). This is number of thermal units needed for 
> > > the organism to develop to the next stage (e.g. instar for an 
> > > insect, or fruit/flower formation for a plant). However, better 
> > > accuracy is obtained if the model includes both min and max 
> > > thresholds.
> > >
> > > All I have done is provide an example where min and max could have 
> > > a real world use. I use max(temp) over some interval and then 
> > > update an accumulated thermal units variable based on the outcome.
> > > That detail is not evident in the original request.
> > >
> > > Tim
> > >
> > > -Original Message-
> > > From: R-help  On Behalf Of Richard
> > > O'Keefe
> > > Sent: Wednesday, September 13, 2023 9:58 AM
> > > To: Kevin Zembower 
> > > Cc: r-help@r-project.org
> > > Subject: Re: [R] Help with plotting and date-times for climate
> > > data
> > >
> > > [External Email]
> > >
> > > Off-topic, but what is a "mean temperature max"
> > > and what good would it do you to know you if you did?
> > > I've been looking at a lot of weather station data and for no
> > > question I've ever had (except "would the newspapers get excited
> > > about this") was "max" (or min) the answer.  Considering the way
> > > that temperature can change by several degrees in a few minutes,
> > > or
> > > a few metres -- I meant h

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Kevin Zembower via R-help
Well, I looked for this, on both the NWS and WeatherUnderground, but
couldn't find what I was looking for. Didn't check Weather.com, but if
you can find a chart of the average high and low temperatures in Ely,
MN between about the middle of September to the middle of October, I'll
buy you a beer.

-Kevin

On Wed, 2023-09-13 at 17:39 +, Ebert,Timothy Aaron wrote:
> I admire the dedication to R and data science, but the Weather
> Channel might be a simpler approach. Weather.com. I can search for
> (city name) and either weather (current values) or climate. It
> depends on how far away the trip will be.
> 
> -Original Message-
> From: Kevin Zembower  
> Sent: Wednesday, September 13, 2023 1:22 PM
> To: Richard O'Keefe ; Ebert,Timothy Aaron
> 
> Cc: r-help@r-project.org
> Subject: Re: [R] Help with plotting and date-times for climate data
> 
> [External Email]
> 
> Tim, Richard, y'all are reading too much into this. I believe that
> TMAX is the high temperature of the day, and TMIN is the low. I'm
> trying to compute the average or median high and low temperatures for
> the data I have (2011 to present). I'm going on a trip to this area,
> and want to know how to pack.
> 
> Thanks for your interest.
> 
> -Kevin
> 
> On Thu, 2023-09-14 at 03:07 +1200, Richard O'Keefe wrote:
> > I am well aware of the physiological implications of temperature,
> > and 
> > that is *why* I view recorded TMIN and TMAX at a single point with
> > an 
> > extremely jaundiced eye.  TMAX at shoulder height has very little 
> > relevance to an insect living in grass, for example.  And if TMAX
> > is 
> > sustained for one second, that has very different consequences from
> > if 
> > TMAX is sustained for five minutes.  I can see the usefulness of 
> > "proportion of day above Thi/below Tlo", but that is quite
> > different.
> > 
> > OK, so my interest in weather data was mainly based around water 
> > management: precipitation, evaporation, herd and crop water needs, 
> > that kind of thing.  And the first thing you learn from that 
> > experience is that ANY kind of single-point summary is seriously 
> > misleading.
> > 
> > Let's end this digression.
> > 
> > 
> > On Thu, 14 Sept 2023 at 02:18, Ebert,Timothy Aaron 
> > wrote:
> > > I had the same question.
> > > However, I can partly answer the off-topic question. Min and max
> > > can 
> > > be important as lower and upper development thresholds. Below the
> > > min no growth or development occur because reaction rates are too
> > > slow to enable such. Above max, temperatures are too hot.
> > > Protein function is impaired, and systems stop functioning. There
> > > is 
> > > a considerable range between where systems shut down (but
> > > recover) and tissue death.
> > > In a simple form the growth and physiological stage of plants, 
> > > insects, and many others, can be modeled as a function of 
> > > temperature. These are often called growing degree day models (or
> > > some version of that). This is number of thermal units needed for
> > > the organism to develop to the next stage (e.g. instar for an 
> > > insect, or fruit/flower formation for a plant). However, better 
> > > accuracy is obtained if the model includes both min and max 
> > > thresholds.
> > > 
> > > All I have done is provide an example where min and max could
> > > have a 
> > > real world use. I use max(temp) over some interval and then
> > > update 
> > > an accumulated thermal units variable based on the outcome.
> > > That detail is not evident in the original request.
> > > 
> > > Tim
> > > 
> > > -Original Message-
> > > From: R-help  On Behalf Of Richard 
> > > O'Keefe
> > > Sent: Wednesday, September 13, 2023 9:58 AM
> > > To: Kevin Zembower 
> > > Cc: r-help@r-project.org
> > > Subject: Re: [R] Help with plotting and date-times for climate
> > > data
> > > 
> > > [External Email]
> > > 
> > > Off-topic, but what is a "mean temperature max"
> > > and what good would it do you to know you if you did?
> > > I've been looking at a lot of weather station data and for no 
> > > question I've ever had (except "would the newspapers get excited 
> > > about this") was "max" (or min) the answer.  Considering the way 
> > > that temperature can change by several degrees in a few minutes,
> > > or 
> > > a few metres -- I meant horizontally when I wrote that, but as
> > > you 
> > > know your head and feet don't experience the same temperature,
> > > again 
> > > by more than one degree -- I am at something of a loss to ascribe
> > > much practical significance to TMAX.  Are you sure this is the 
> > > analysis you want to do?  Is this the most informative data you
> > > can 
> > > get?
> > > 
> > > On Wed, 13 Sept 2023 at 08:51, Kevin Zembower via R-help < 
> > > r-help@r-project.org> wrote:
> > > 
> > > > Hello,
> > > > 
> > > > I'm trying to calculate the mean temperature max from a file of
> > > > climate date, and plot it over a range of days in the year.
> > > > I've 
> > > > downloaded 

Re: [R] graph in R with grouping letters from the turkey test with agricolae package

2023-09-13 Thread peter dalgaard
Yes. Old John T. must be turning on his skewer...er, in his grave, I mean.

(I gather he was actually more amicable than that, though.)

- pd

> On 13 Sep 2023, at 16:20 , Ben Bolker  wrote:
> 
>  As a side note, I'm curious how often "Tukey test" is misspelled as "Turkey 
> test".
> 
> 
> Googling '"turkey test" mean comparison' gives 36.1K results (vs 14.3M for 
> '"tukey test" mean comparison" ...
> 
> 
> 
> On 2023-09-13 10:02 a.m., Richard O'Keefe wrote:
>>> d <- read.table("data.txt", TRUE)
>>> cor(d[, 3:6])
>>  VAR1 VAR2 VAR3 VAR4
>> VAR11111
>> VAR21111
>> VAR31111
>> VAR41111
>> VAR1 to VAR4 are, up to linear scaling,
>> exactly the same variable.  Why is that?
>> On Wed, 13 Sept 2023 at 07:38, Loop Vinyl  wrote:
>>> I would like to produce the attached graph (graph1) with the R package
>>> agricolae, could someone give me an example with the attached data (data)?
>>> 
>>> I expect an adapted graph (graph2) with the data (data)
>>> 
>>> Best regards
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> 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.
>>> 
>>  [[alternative HTML version deleted]]
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.
> 
> -- 
> Dr. Benjamin Bolker
> Professor, Mathematics & Statistics and Biology, McMaster University
> Director, School of Computational Science and Engineering
> (Acting) Graduate chair, Mathematics & Statistics
> > E-mail is sent at my convenience; I don't expect replies outside of working 
> > hours.
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
I admire the dedication to R and data science, but the Weather Channel might be 
a simpler approach. Weather.com. I can search for (city name) and either 
weather (current values) or climate. It depends on how far away the trip will 
be.

-Original Message-
From: Kevin Zembower  
Sent: Wednesday, September 13, 2023 1:22 PM
To: Richard O'Keefe ; Ebert,Timothy Aaron 
Cc: r-help@r-project.org
Subject: Re: [R] Help with plotting and date-times for climate data

[External Email]

Tim, Richard, y'all are reading too much into this. I believe that TMAX is the 
high temperature of the day, and TMIN is the low. I'm trying to compute the 
average or median high and low temperatures for the data I have (2011 to 
present). I'm going on a trip to this area, and want to know how to pack.

Thanks for your interest.

-Kevin

On Thu, 2023-09-14 at 03:07 +1200, Richard O'Keefe wrote:
> I am well aware of the physiological implications of temperature, and 
> that is *why* I view recorded TMIN and TMAX at a single point with an 
> extremely jaundiced eye.  TMAX at shoulder height has very little 
> relevance to an insect living in grass, for example.  And if TMAX is 
> sustained for one second, that has very different consequences from if 
> TMAX is sustained for five minutes.  I can see the usefulness of 
> "proportion of day above Thi/below Tlo", but that is quite different.
>
> OK, so my interest in weather data was mainly based around water 
> management: precipitation, evaporation, herd and crop water needs, 
> that kind of thing.  And the first thing you learn from that 
> experience is that ANY kind of single-point summary is seriously 
> misleading.
>
> Let's end this digression.
>
>
> On Thu, 14 Sept 2023 at 02:18, Ebert,Timothy Aaron 
> wrote:
> > I had the same question.
> > However, I can partly answer the off-topic question. Min and max can 
> > be important as lower and upper development thresholds. Below the 
> > min no growth or development occur because reaction rates are too 
> > slow to enable such. Above max, temperatures are too hot.
> > Protein function is impaired, and systems stop functioning. There is 
> > a considerable range between where systems shut down (but
> > recover) and tissue death.
> > In a simple form the growth and physiological stage of plants, 
> > insects, and many others, can be modeled as a function of 
> > temperature. These are often called growing degree day models (or 
> > some version of that). This is number of thermal units needed for 
> > the organism to develop to the next stage (e.g. instar for an 
> > insect, or fruit/flower formation for a plant). However, better 
> > accuracy is obtained if the model includes both min and max 
> > thresholds.
> >
> > All I have done is provide an example where min and max could have a 
> > real world use. I use max(temp) over some interval and then update 
> > an accumulated thermal units variable based on the outcome.
> > That detail is not evident in the original request.
> >
> > Tim
> >
> > -Original Message-
> > From: R-help  On Behalf Of Richard 
> > O'Keefe
> > Sent: Wednesday, September 13, 2023 9:58 AM
> > To: Kevin Zembower 
> > Cc: r-help@r-project.org
> > Subject: Re: [R] Help with plotting and date-times for climate data
> >
> > [External Email]
> >
> > Off-topic, but what is a "mean temperature max"
> > and what good would it do you to know you if you did?
> > I've been looking at a lot of weather station data and for no 
> > question I've ever had (except "would the newspapers get excited 
> > about this") was "max" (or min) the answer.  Considering the way 
> > that temperature can change by several degrees in a few minutes, or 
> > a few metres -- I meant horizontally when I wrote that, but as you 
> > know your head and feet don't experience the same temperature, again 
> > by more than one degree -- I am at something of a loss to ascribe 
> > much practical significance to TMAX.  Are you sure this is the 
> > analysis you want to do?  Is this the most informative data you can 
> > get?
> >
> > On Wed, 13 Sept 2023 at 08:51, Kevin Zembower via R-help < 
> > r-help@r-project.org> wrote:
> >
> > > Hello,
> > >
> > > I'm trying to calculate the mean temperature max from a file of 
> > > climate date, and plot it over a range of days in the year. I've 
> > > downloaded the data, and cleaned it up the way I think it should 
> > > be.
> > > However, when I plot it, the geom_smooth line doesn't show up. I 
> > > think that's because my x axis is characters or factors. Here's 
> > > what I have so far:
> > > 
> > > library(tidyverse)
> > >
> > > data <- read_csv("Ely_MN_Weather.csv")
> > >
> > > start_day = yday(as_date("2023-09-22")) end_day =
> > > yday(as_date("2023-10-15"))
> > >
> > > d <- as_tibble(data) %>%
> > >  select(DATE,TMAX,TMIN) %>%
> > >  mutate(DATE = as_date(DATE),
> > > yday = yday(DATE),
> > > md = sprintf("%02d-%02d", mo

Re: [R] Help with plotting and date-times for climate data

2023-09-13 Thread Kevin Zembower via R-help
Rui, thanks so much for your clear explanation, solution to my problem,
and additional help with making the graph come out exactly as I was
hoping. I learned a lot from your solution. Thanks, again, for your
help.

-Kevin

On Tue, 2023-09-12 at 23:06 +0100, Rui Barradas wrote:
> Às 21:50 de 12/09/2023, Kevin Zembower via R-help escreveu:
> > Hello,
> > 
> > I'm trying to calculate the mean temperature max from a file of
> > climate
> > date, and plot it over a range of days in the year. I've downloaded
> > the
> > data, and cleaned it up the way I think it should be. However, when
> > I
> > plot it, the geom_smooth line doesn't show up. I think that's
> > because
> > my x axis is characters or factors. Here's what I have so far:
> > 
> > library(tidyverse)
> > 
> > data <- read_csv("Ely_MN_Weather.csv")
> > 
> > start_day = yday(as_date("2023-09-22"))
> > end_day = yday(as_date("2023-10-15"))
> >     
> > d <- as_tibble(data) %>%
> >  select(DATE,TMAX,TMIN) %>%
> >  mutate(DATE = as_date(DATE),
> >     yday = yday(DATE),
> >     md = sprintf("%02d-%02d", month(DATE), mday(DATE))
> >     ) %>%
> >  filter(yday >= start_day & yday <= end_day) %>%
> >  mutate(md = as.factor(md))
> > 
> > d_sum <- d %>%
> >  group_by(md) %>%
> >  summarize(tmax_mean = mean(TMAX, na.rm=TRUE))
> > 
> > ## Here's the filtered data:
> > dput(d_sum)
> > 
> > > structure(list(md = structure(1:25, levels = c("09-21", "09-22",
> > "09-23", "09-24", "09-25", "09-26", "09-27", "09-28", "09-29",
> > "09-30", "10-01", "10-02", "10-03", "10-04", "10-05", "10-06",
> > "10-07", "10-08", "10-09", "10-10", "10-11", "10-12", "10-13",
> > "10-14", "10-15"), class = "factor"), tmax_mean = c(65,
> > 62.2,
> > 61.3, 63.9, 64.3, 60.1, 62.3, 60.5, 61.9,
> > 61.2, 63.7, 59.5, 59.6, 61.6,
> > 59.4, 58.8, 55.9, 58.125,
> > 58, 55.7, 57, 55.4, 49.8,
> > 48.75, 43.7)), class = c("tbl_df", "tbl", "data.frame"
> > ), row.names = c(NA, -25L))
> > > 
> > ggplot(data = d_sum, aes(x = md)) +
> >  geom_point(aes(y = tmax_mean, color = "blue")) +
> >  geom_smooth(aes(y = tmax_mean, color = "blue"))
> > =
> > My questions are:
> > 1. Why isn't my geom_smooth plotting? How can I fix it?
> > 2. I don't think I'm handling the month and day combination
> > correctly.
> > Is there a way to encode month and day (but not year) as a date?
> > 3. (Minor point) Why does my graph of tmax_mean come out red when I
> > specify "blue"?
> > 
> > Thanks for any advice or guidance you can offer. I really
> > appreciate
> > the expertise of this group.
> > 
> > -Kevin
> > 
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
> Hello,
> 
> The problem is that the dates are factors, not real dates. And 
> geom_smooth is not interpolating along a discrete axis (the x axis).
> 
> Paste a fake year with md, coerce to date and plot.
> I have simplified the aes() calls and added a date scale in order to 
> make the x axis more readable.
> 
> Without the formula and method arguments, geom_smooth will print a 
> message, they are now made explicit.
> 
> 
> 
> suppressPackageStartupMessages({
>    library(dplyr)
>    library(ggplot2)
> })
> 
> d_sum %>%
>    mutate(md = paste("2023", md, sep = "-"),
>   md = as.Date(md)) %>%
>    ggplot(aes(x = md, y = tmax_mean)) +
>    geom_point(color = "blue") +
>    geom_smooth(
>  formula = y ~ x,
>  method = loess,
>  color = "blue"
>    ) +
>    scale_x_date(date_breaks = "7 days", date_labels = "%m-%d")
> 
> 
> 
> Hope this helps,
> 
> Rui Barradas
> 



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Help with plotting and date-times for climate data

2023-09-13 Thread Kevin Zembower via R-help
Tim, Richard, y'all are reading too much into this. I believe that TMAX
is the high temperature of the day, and TMIN is the low. I'm trying to
compute the average or median high and low temperatures for the data I
have (2011 to present). I'm going on a trip to this area, and want to
know how to pack.

Thanks for your interest.

-Kevin

On Thu, 2023-09-14 at 03:07 +1200, Richard O'Keefe wrote:
> I am well aware of the physiological implications
> of temperature, and that is *why* I view recorded
> TMIN and TMAX at a single point with an extremely
> jaundiced eye.  TMAX at shoulder height has very
> little relevance to an insect living in grass, for
> example.  And if TMAX is sustained for one second,
> that has very different consequences from if TMAX
> is sustained for five minutes.  I can see the usefulness
> of "proportion of day above Thi/below Tlo", but that
> is quite different.
> 
> OK, so my interest in weather data was mainly based
> around water management: precipitation, evaporation,
> herd and crop water needs, that kind of thing.  And
> the first thing you learn from that experience is
> that ANY kind of single-point summary is seriously
> misleading.
> 
> Let's end this digression.
> 
> 
> On Thu, 14 Sept 2023 at 02:18, Ebert,Timothy Aaron 
> wrote:
> > I had the same question.
> > However, I can partly answer the off-topic question. Min and max
> > can be important as lower and upper development thresholds. Below
> > the min no growth or development occur because reaction rates are
> > too slow to enable such. Above max, temperatures are too hot.
> > Protein function is impaired, and systems stop functioning. There
> > is a considerable range between where systems shut down (but
> > recover) and tissue death.
> > In a simple form the growth and physiological stage of plants,
> > insects, and many others, can be modeled as a function of
> > temperature. These are often called growing degree day models (or
> > some version of that). This is number of thermal units needed for
> > the organism to develop to the next stage (e.g. instar for an
> > insect, or fruit/flower formation for a plant). However, better
> > accuracy is obtained if the model includes both min and max
> > thresholds.
> > 
> > All I have done is provide an example where min and max could have
> > a real world use. I use max(temp) over some interval and then
> > update an accumulated thermal units variable based on the outcome.
> > That detail is not evident in the original request.
> > 
> > Tim
> > 
> > -Original Message-
> > From: R-help  On Behalf Of Richard
> > O'Keefe
> > Sent: Wednesday, September 13, 2023 9:58 AM
> > To: Kevin Zembower 
> > Cc: r-help@r-project.org
> > Subject: Re: [R] Help with plotting and date-times for climate data
> > 
> > [External Email]
> > 
> > Off-topic, but what is a "mean temperature max"
> > and what good would it do you to know you if you did?
> > I've been looking at a lot of weather station data and for no
> > question I've ever had (except "would the newspapers get excited
> > about this") was "max" (or min) the answer.  Considering the way
> > that temperature can change by several degrees in a few minutes, or
> > a few metres -- I meant horizontally when I wrote that, but as you
> > know your head and feet don't experience the same temperature,
> > again by more than one degree -- I am at something of a loss to
> > ascribe much practical significance to TMAX.  Are you sure this is
> > the analysis you want to do?  Is this the most informative data you
> > can get?
> > 
> > On Wed, 13 Sept 2023 at 08:51, Kevin Zembower via R-help <
> > r-help@r-project.org> wrote:
> > 
> > > Hello,
> > > 
> > > I'm trying to calculate the mean temperature max from a file of
> > > climate date, and plot it over a range of days in the year. I've
> > > downloaded the data, and cleaned it up the way I think it should
> > > be.
> > > However, when I plot it, the geom_smooth line doesn't show up. I
> > > think
> > > that's because my x axis is characters or factors. Here's what I
> > > have so far:
> > > 
> > > library(tidyverse)
> > > 
> > > data <- read_csv("Ely_MN_Weather.csv")
> > > 
> > > start_day = yday(as_date("2023-09-22")) end_day =
> > > yday(as_date("2023-10-15"))
> > > 
> > > d <- as_tibble(data) %>%
> > >      select(DATE,TMAX,TMIN) %>%
> > >      mutate(DATE = as_date(DATE),
> > >             yday = yday(DATE),
> > >             md = sprintf("%02d-%02d", month(DATE), mday(DATE))
> > >             ) %>%
> > >      filter(yday >= start_day & yday <= end_day) %>%
> > >      mutate(md = as.factor(md))
> > > 
> > > d_sum <- d %>%
> > >      group_by(md) %>%
> > >      summarize(tmax_mean = mean(TMAX, na.rm=TRUE))
> > > 
> > > ## Here's the filtered data:
> > > dput(d_sum)
> > > 
> > > > structure(list(md = structure(1:25, levels = c("09-21", "09-
> > > > 22",
> > > "09-23", "09-24", "09-25", "09-26", "09-27", "09-28", "09-29",
> > > "09-30", "10-01", "1

Re: [R] graph in R with grouping letters from the turkey test with agricolae package

2023-09-13 Thread Ebert,Timothy Aaron
+"turkey test +"mean comparison" 84 hits in google scholar.

There is an aphid "Aphis gossypii." Some people have changed this to "Apis 
gossypii." "Apis" is a genus for bees, and there is no critter named "Apis 
gossypii." However there are 45 papers in google scholar suffering from this 
malady. Some of them the error is in the way the paper was entered into the 
search engine. If I look at the published paper there is no mistake. It is most 
fun when Apis mellifera and Apis gossypii exist in the same paper.


In the USA, thanksgiving is a holiday that often includes a meal with turkey. 
Sometimes the holiday is called turkey day. I wrote in the stats lab "Happy 
Tukey Day". While most things were erased after a day or so, this stayed for 
several months.


Tim

-Original Message-
From: R-help  On Behalf Of Ben Bolker
Sent: Wednesday, September 13, 2023 10:20 AM
To: r-help@r-project.org
Subject: Re: [R] graph in R with grouping letters from the turkey test with 
agricolae package

[External Email]

   As a side note, I'm curious how often "Tukey test" is misspelled as "Turkey 
test".


Googling '"turkey test" mean comparison' gives 36.1K results (vs 14.3M for 
'"tukey test" mean comparison" ...



On 2023-09-13 10:02 a.m., Richard O'Keefe wrote:
>> d <- read.table("data.txt", TRUE)
>> cor(d[, 3:6])
>   VAR1 VAR2 VAR3 VAR4
> VAR11111
> VAR21111
> VAR31111
> VAR41111
>
> VAR1 to VAR4 are, up to linear scaling, exactly the same variable.
> Why is that?
>
>
> On Wed, 13 Sept 2023 at 07:38, Loop Vinyl  wrote:
>
>> I would like to produce the attached graph (graph1) with the R
>> package agricolae, could someone give me an example with the attached data 
>> (data)?
>>
>> I expect an adapted graph (graph2) with the data (data)
>>
>> Best regards
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://sta/
>> t.ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=05%7C01%7Ctebert%40ufl.e
>> du%7C3610c6d64e8f4d139df408dbb465daba%7C0d4da0f84a314d76ace60a62331e1
>> b84%7C0%7C0%7C638302121786328675%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4w
>> LjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7
>> C&sdata=7quLdbmh83%2BJqwfZHISjo4KeH3tNT6h%2BlotUj2cr5hs%3D&reserved=0
>> PLEASE do read the posting guide
>> http://www/.
>> r-project.org%2Fposting-guide.html&data=05%7C01%7Ctebert%40ufl.edu%7C
>> 3610c6d64e8f4d139df408dbb465daba%7C0d4da0f84a314d76ace60a62331e1b84%7
>> C0%7C0%7C638302121786328675%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM
>> DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sda
>> ta=s8cw488pbXCFKqt2M2f%2ByvJ0w6OaIwW1beDEcBF%2B%2FbE%3D&reserved=0
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>   [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat/
> .ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=05%7C01%7Ctebert%40ufl.edu
> %7C3610c6d64e8f4d139df408dbb465daba%7C0d4da0f84a314d76ace60a62331e1b84
> %7C0%7C0%7C638302121786328675%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sda
> ta=7quLdbmh83%2BJqwfZHISjo4KeH3tNT6h%2BlotUj2cr5hs%3D&reserved=0
> PLEASE do read the posting guide
> http://www.r/
> -project.org%2Fposting-guide.html&data=05%7C01%7Ctebert%40ufl.edu%7C36
> 10c6d64e8f4d139df408dbb465daba%7C0d4da0f84a314d76ace60a62331e1b84%7C0%
> 7C0%7C638302121786328675%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL
> CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=s8
> cw488pbXCFKqt2M2f%2ByvJ0w6OaIwW1beDEcBF%2B%2FbE%3D&reserved=0
> and provide commented, minimal, self-contained, reproducible code.

--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University Director, 
School of Computational Science and Engineering
(Acting) Graduate chair, Mathematics & Statistics  > E-mail is sent at my 
convenience; I don't expect replies outside of working hours.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Help with plotting and date-times for climate data

2023-09-13 Thread Richard O'Keefe
I am well aware of the physiological implications
of temperature, and that is *why* I view recorded
TMIN and TMAX at a single point with an extremely
jaundiced eye.  TMAX at shoulder height has very
little relevance to an insect living in grass, for
example.  And if TMAX is sustained for one second,
that has very different consequences from if TMAX
is sustained for five minutes.  I can see the usefulness
of "proportion of day above Thi/below Tlo", but that
is quite different.

OK, so my interest in weather data was mainly based
around water management: precipitation, evaporation,
herd and crop water needs, that kind of thing.  And
the first thing you learn from that experience is
that ANY kind of single-point summary is seriously
misleading.

Let's end this digression.


On Thu, 14 Sept 2023 at 02:18, Ebert,Timothy Aaron  wrote:

> I had the same question.
> However, I can partly answer the off-topic question. Min and max can be
> important as lower and upper development thresholds. Below the min no
> growth or development occur because reaction rates are too slow to enable
> such. Above max, temperatures are too hot. Protein function is impaired,
> and systems stop functioning. There is a considerable range between where
> systems shut down (but recover) and tissue death.
> In a simple form the growth and physiological stage of plants, insects,
> and many others, can be modeled as a function of temperature. These are
> often called growing degree day models (or some version of that). This is
> number of thermal units needed for the organism to develop to the next
> stage (e.g. instar for an insect, or fruit/flower formation for a plant).
> However, better accuracy is obtained if the model includes both min and max
> thresholds.
>
> All I have done is provide an example where min and max could have a real
> world use. I use max(temp) over some interval and then update an
> accumulated thermal units variable based on the outcome. That detail is not
> evident in the original request.
>
> Tim
>
> -Original Message-
> From: R-help  On Behalf Of Richard O'Keefe
> Sent: Wednesday, September 13, 2023 9:58 AM
> To: Kevin Zembower 
> Cc: r-help@r-project.org
> Subject: Re: [R] Help with plotting and date-times for climate data
>
> [External Email]
>
> Off-topic, but what is a "mean temperature max"
> and what good would it do you to know you if you did?
> I've been looking at a lot of weather station data and for no question
> I've ever had (except "would the newspapers get excited about this") was
> "max" (or min) the answer.  Considering the way that temperature can change
> by several degrees in a few minutes, or a few metres -- I meant
> horizontally when I wrote that, but as you know your head and feet don't
> experience the same temperature, again by more than one degree -- I am at
> something of a loss to ascribe much practical significance to TMAX.  Are
> you sure this is the analysis you want to do?  Is this the most informative
> data you can get?
>
> On Wed, 13 Sept 2023 at 08:51, Kevin Zembower via R-help <
> r-help@r-project.org> wrote:
>
> > Hello,
> >
> > I'm trying to calculate the mean temperature max from a file of
> > climate date, and plot it over a range of days in the year. I've
> > downloaded the data, and cleaned it up the way I think it should be.
> > However, when I plot it, the geom_smooth line doesn't show up. I think
> > that's because my x axis is characters or factors. Here's what I have so
> far:
> > 
> > library(tidyverse)
> >
> > data <- read_csv("Ely_MN_Weather.csv")
> >
> > start_day = yday(as_date("2023-09-22")) end_day =
> > yday(as_date("2023-10-15"))
> >
> > d <- as_tibble(data) %>%
> > select(DATE,TMAX,TMIN) %>%
> > mutate(DATE = as_date(DATE),
> >yday = yday(DATE),
> >md = sprintf("%02d-%02d", month(DATE), mday(DATE))
> >) %>%
> > filter(yday >= start_day & yday <= end_day) %>%
> > mutate(md = as.factor(md))
> >
> > d_sum <- d %>%
> > group_by(md) %>%
> > summarize(tmax_mean = mean(TMAX, na.rm=TRUE))
> >
> > ## Here's the filtered data:
> > dput(d_sum)
> >
> > > structure(list(md = structure(1:25, levels = c("09-21", "09-22",
> > "09-23", "09-24", "09-25", "09-26", "09-27", "09-28", "09-29",
> > "09-30", "10-01", "10-02", "10-03", "10-04", "10-05", "10-06",
> > "10-07", "10-08", "10-09", "10-10", "10-11", "10-12", "10-13",
> > "10-14", "10-15"), class = "factor"), tmax_mean = c(65,
> > 62.2, 61.3, 63.9, 64.3, 60.1,
> > 62.3, 60.5, 61.9, 61.2, 63.7, 59.5, 59.6,
> > 61.6, 59.4, 58.8,
> > 55.9, 58.125, 58, 55.7, 57, 55.4,
> > 49.8, 48.75, 43.7)), class = c("tbl_df",
> > "tbl", "data.frame"
> > ), row.names = c(NA, -25L))
> > >
> > ggplot(data = d_sum, aes(x = md)) +
> > geom_point(aes(y = tmax_mean, color = "blue"

Re: [R] graph in R with grouping letters from the turkey test with agricolae package

2023-09-13 Thread Ben Bolker
  As a side note, I'm curious how often "Tukey test" is misspelled as 
"Turkey test".



Googling '"turkey test" mean comparison' gives 36.1K results (vs 14.3M 
for '"tukey test" mean comparison" ...




On 2023-09-13 10:02 a.m., Richard O'Keefe wrote:

d <- read.table("data.txt", TRUE)
cor(d[, 3:6])

  VAR1 VAR2 VAR3 VAR4
VAR11111
VAR21111
VAR31111
VAR41111

VAR1 to VAR4 are, up to linear scaling,
exactly the same variable.  Why is that?


On Wed, 13 Sept 2023 at 07:38, Loop Vinyl  wrote:


I would like to produce the attached graph (graph1) with the R package
agricolae, could someone give me an example with the attached data (data)?

I expect an adapted graph (graph2) with the data (data)

Best regards
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
(Acting) Graduate chair, Mathematics & Statistics
> E-mail is sent at my convenience; I don't expect replies outside of 
working hours.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Help with plotting and date-times for climate data

2023-09-13 Thread Ebert,Timothy Aaron
I had the same question.
However, I can partly answer the off-topic question. Min and max can be 
important as lower and upper development thresholds. Below the min no growth or 
development occur because reaction rates are too slow to enable such. Above 
max, temperatures are too hot. Protein function is impaired, and systems stop 
functioning. There is a considerable range between where systems shut down (but 
recover) and tissue death.
In a simple form the growth and physiological stage of plants, insects, and 
many others, can be modeled as a function of temperature. These are often 
called growing degree day models (or some version of that). This is number of 
thermal units needed for the organism to develop to the next stage (e.g. instar 
for an insect, or fruit/flower formation for a plant). However, better accuracy 
is obtained if the model includes both min and max thresholds.

All I have done is provide an example where min and max could have a real world 
use. I use max(temp) over some interval and then update an accumulated thermal 
units variable based on the outcome. That detail is not evident in the original 
request.

Tim

-Original Message-
From: R-help  On Behalf Of Richard O'Keefe
Sent: Wednesday, September 13, 2023 9:58 AM
To: Kevin Zembower 
Cc: r-help@r-project.org
Subject: Re: [R] Help with plotting and date-times for climate data

[External Email]

Off-topic, but what is a "mean temperature max"
and what good would it do you to know you if you did?
I've been looking at a lot of weather station data and for no question I've 
ever had (except "would the newspapers get excited about this") was "max" (or 
min) the answer.  Considering the way that temperature can change by several 
degrees in a few minutes, or a few metres -- I meant horizontally when I wrote 
that, but as you know your head and feet don't experience the same temperature, 
again by more than one degree -- I am at something of a loss to ascribe much 
practical significance to TMAX.  Are you sure this is the analysis you want to 
do?  Is this the most informative data you can get?

On Wed, 13 Sept 2023 at 08:51, Kevin Zembower via R-help < 
r-help@r-project.org> wrote:

> Hello,
>
> I'm trying to calculate the mean temperature max from a file of
> climate date, and plot it over a range of days in the year. I've
> downloaded the data, and cleaned it up the way I think it should be.
> However, when I plot it, the geom_smooth line doesn't show up. I think
> that's because my x axis is characters or factors. Here's what I have so far:
> 
> library(tidyverse)
>
> data <- read_csv("Ely_MN_Weather.csv")
>
> start_day = yday(as_date("2023-09-22")) end_day =
> yday(as_date("2023-10-15"))
>
> d <- as_tibble(data) %>%
> select(DATE,TMAX,TMIN) %>%
> mutate(DATE = as_date(DATE),
>yday = yday(DATE),
>md = sprintf("%02d-%02d", month(DATE), mday(DATE))
>) %>%
> filter(yday >= start_day & yday <= end_day) %>%
> mutate(md = as.factor(md))
>
> d_sum <- d %>%
> group_by(md) %>%
> summarize(tmax_mean = mean(TMAX, na.rm=TRUE))
>
> ## Here's the filtered data:
> dput(d_sum)
>
> > structure(list(md = structure(1:25, levels = c("09-21", "09-22",
> "09-23", "09-24", "09-25", "09-26", "09-27", "09-28", "09-29",
> "09-30", "10-01", "10-02", "10-03", "10-04", "10-05", "10-06",
> "10-07", "10-08", "10-09", "10-10", "10-11", "10-12", "10-13",
> "10-14", "10-15"), class = "factor"), tmax_mean = c(65,
> 62.2, 61.3, 63.9, 64.3, 60.1,
> 62.3, 60.5, 61.9, 61.2, 63.7, 59.5, 59.6,
> 61.6, 59.4, 58.8,
> 55.9, 58.125, 58, 55.7, 57, 55.4,
> 49.8, 48.75, 43.7)), class = c("tbl_df",
> "tbl", "data.frame"
> ), row.names = c(NA, -25L))
> >
> ggplot(data = d_sum, aes(x = md)) +
> geom_point(aes(y = tmax_mean, color = "blue")) +
> geom_smooth(aes(y = tmax_mean, color = "blue"))
> =
> My questions are:
> 1. Why isn't my geom_smooth plotting? How can I fix it?
> 2. I don't think I'm handling the month and day combination correctly.
> Is there a way to encode month and day (but not year) as a date?
> 3. (Minor point) Why does my graph of tmax_mean come out red when I
> specify "blue"?
>
> Thanks for any advice or guidance you can offer. I really appreciate
> the expertise of this group.
>
> -Kevin
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat/
> .ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=05%7C01%7Ctebert%40ufl.edu
> %7C41f002949dac426196de08dbb4619001%7C0d4da0f84a314d76ace60a62331e1b84
> %7C0%7C0%7C638302103358987487%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sda
> ta=dfC3W%2F%2BBsZI0EaAx%2FocRgw81PSJH8sVZHPFB4rMyia

Re: [R] graph in R with grouping letters from the turkey test with agricolae package

2023-09-13 Thread Richard O'Keefe
> d <- read.table("data.txt", TRUE)
> cor(d[, 3:6])
 VAR1 VAR2 VAR3 VAR4
VAR11111
VAR21111
VAR31111
VAR41111

VAR1 to VAR4 are, up to linear scaling,
exactly the same variable.  Why is that?


On Wed, 13 Sept 2023 at 07:38, Loop Vinyl  wrote:

> I would like to produce the attached graph (graph1) with the R package
> agricolae, could someone give me an example with the attached data (data)?
>
> I expect an adapted graph (graph2) with the data (data)
>
> Best regards
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] Help with plotting and date-times for climate data

2023-09-13 Thread Richard O'Keefe
Off-topic, but what is a "mean temperature max"
and what good would it do you to know you if you did?
I've been looking at a lot of weather station data
and for no question I've ever had (except "would the
newspapers get excited about this") was "max" (or min)
the answer.  Considering the way that temperature can
change by several degrees in a few minutes, or a few
metres -- I meant horizontally when I wrote that, but
as you know your head and feet don't experience the
same temperature, again by more than one degree -- I am
at something of a loss to ascribe much practical
significance to TMAX.  Are you sure this is the analysis
you want to do?  Is this the most informative data you
can get?

On Wed, 13 Sept 2023 at 08:51, Kevin Zembower via R-help <
r-help@r-project.org> wrote:

> Hello,
>
> I'm trying to calculate the mean temperature max from a file of climate
> date, and plot it over a range of days in the year. I've downloaded the
> data, and cleaned it up the way I think it should be. However, when I
> plot it, the geom_smooth line doesn't show up. I think that's because
> my x axis is characters or factors. Here's what I have so far:
> 
> library(tidyverse)
>
> data <- read_csv("Ely_MN_Weather.csv")
>
> start_day = yday(as_date("2023-09-22"))
> end_day = yday(as_date("2023-10-15"))
>
> d <- as_tibble(data) %>%
> select(DATE,TMAX,TMIN) %>%
> mutate(DATE = as_date(DATE),
>yday = yday(DATE),
>md = sprintf("%02d-%02d", month(DATE), mday(DATE))
>) %>%
> filter(yday >= start_day & yday <= end_day) %>%
> mutate(md = as.factor(md))
>
> d_sum <- d %>%
> group_by(md) %>%
> summarize(tmax_mean = mean(TMAX, na.rm=TRUE))
>
> ## Here's the filtered data:
> dput(d_sum)
>
> > structure(list(md = structure(1:25, levels = c("09-21", "09-22",
> "09-23", "09-24", "09-25", "09-26", "09-27", "09-28", "09-29",
> "09-30", "10-01", "10-02", "10-03", "10-04", "10-05", "10-06",
> "10-07", "10-08", "10-09", "10-10", "10-11", "10-12", "10-13",
> "10-14", "10-15"), class = "factor"), tmax_mean = c(65,
> 62.2,
> 61.3, 63.9, 64.3, 60.1, 62.3, 60.5, 61.9,
> 61.2, 63.7, 59.5, 59.6, 61.6,
> 59.4, 58.8, 55.9, 58.125,
> 58, 55.7, 57, 55.4, 49.8,
> 48.75, 43.7)), class = c("tbl_df", "tbl", "data.frame"
> ), row.names = c(NA, -25L))
> >
> ggplot(data = d_sum, aes(x = md)) +
> geom_point(aes(y = tmax_mean, color = "blue")) +
> geom_smooth(aes(y = tmax_mean, color = "blue"))
> =
> My questions are:
> 1. Why isn't my geom_smooth plotting? How can I fix it?
> 2. I don't think I'm handling the month and day combination correctly.
> Is there a way to encode month and day (but not year) as a date?
> 3. (Minor point) Why does my graph of tmax_mean come out red when I
> specify "blue"?
>
> Thanks for any advice or guidance you can offer. I really appreciate
> the expertise of this group.
>
> -Kevin
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.