An alternative is the lubridate() package if you use tidyverse.

Check the data for daylight savings time. Twice per year Virginia changes time 
where in the Fall clocks are shifted back an hour and in the Spring they jump 
forwards an hour.

-----Original Message-----
From: R-help <r-help-boun...@r-project.org> On Behalf Of Jeff Newmiller
Sent: Monday, July 18, 2022 12:35 AM
To: Greg Comcast Coats <gregco...@me.com>; Gregory Coats via R-help 
<r-help@r-project.org>
Subject: Re: [R] Date and Time

[External Email]

Maybe this [1] will help? Or just read ?strptime...

You can also calculate sunrise/sunset (crepuscule) using maptools, but you need 
to be careful with timezones.

[1] 
https://urldefense.proofpoint.com/v2/url?u=https-3A__jdnewmil.github.io_time-2D2018-2D10_MoreDatetimeHowto.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=Eym42IWzdKGREg7m9o0QowA8hP-DgHTrlZwDfW5no2rP6ND_uFJKHbJ_Dj3XGPiP&s=O5VruA8vvqyhQngUZ3fuZtnZiYIm9XEscpzxcGKX9AQ&e=

On July 17, 2022 8:47:19 PM PDT, Gregory Coats via R-help 
<r-help@r-project.org> wrote:
>For the year from 2022-01-01 to 2022-12-31, I computed the sunrise and sunset 
>times for Reston, Virginia, USA. I am seeking the syntax to direct R to read 
>in these dates and times, and then graphical plot the sunrise and sunset times 
>for each day in the year 2022. How do I tell R that I store the Sunrise Date 
>and Time like this?
>YYYY-mm-dd HH:MM:SS
>2022-01-01  7:28:10
>2022-01-02  7:28:17
>Greg Coats
>       [[alternative HTML version deleted]]
>
>______________________________________________
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
>https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailm
>an_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRz
>sn7AkP-g&m=Eym42IWzdKGREg7m9o0QowA8hP-DgHTrlZwDfW5no2rP6ND_uFJKHbJ_Dj3X
>GPiP&s=7XAM9jGAgm-2KbQG5x3oKKxrvNESM5DAvl_O3YxSU3Y&e=
>PLEASE do read the posting guide 
>https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org
>_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsR
>zsn7AkP-g&m=Eym42IWzdKGREg7m9o0QowA8hP-DgHTrlZwDfW5no2rP6ND_uFJKHbJ_Dj3
>XGPiP&s=MwaLmYJXfAwQDsHSzq8Atm-QC2YpJYie_L5oNkAJiVg&e=
>and provide commented, minimal, self-contained, reproducible code.

--
Sent from my phone. Please excuse my brevity.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=Eym42IWzdKGREg7m9o0QowA8hP-DgHTrlZwDfW5no2rP6ND_uFJKHbJ_Dj3XGPiP&s=7XAM9jGAgm-2KbQG5x3oKKxrvNESM5DAvl_O3YxSU3Y&e=
PLEASE do read the posting guide 
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=Eym42IWzdKGREg7m9o0QowA8hP-DgHTrlZwDfW5no2rP6ND_uFJKHbJ_Dj3XGPiP&s=MwaLmYJXfAwQDsHSzq8Atm-QC2YpJYie_L5oNkAJiVg&e=
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.

Reply via email to