You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
3 years ago | |
---|---|---|
R | 3 years ago | |
inst/tinytest | 3 years ago | |
man | 3 years ago | |
src | 3 years ago | |
tests | 3 years ago | |
.Rbuildignore | 3 years ago | |
.codecov.yml | 3 years ago | |
.gitignore | 3 years ago | |
.travis.yml | 3 years ago | |
CONDUCT.md | 3 years ago | |
DESCRIPTION | 3 years ago | |
LICENSE | 3 years ago | |
LICENSE.md | 3 years ago | |
NAMESPACE | 3 years ago | |
NEWS.md | 3 years ago | |
README.Rmd | 3 years ago | |
README.md | 3 years ago | |
daybreak.Rproj | 3 years ago |
README.md
daybreak
Compute Sun Rise/Set Times, Start/End of Twilight, and the Length of the Day at Any Date and Latitude
Description
A wrapper for Paul Schlyter’s C-based library for computing sunrise, sunset, twilight start and end, plus the length of day for a given data and coordinates.
What’s Inside The Tin
The following functions are implemented:
astronomical_twilight
: Astronomical twilightcivil_twilight
: Civil twilightday_astronomical_twilight_length
: Length of astronomical twilightday_civil_twilight_length
: Length of civil twilightday_length
: Length of dayday_nautical_twilight_length
: Length of nautical twilightnautical_twilight
: Nautical twilightsun_rise_set
: Sun rise/set times
Installation
install.packages("daybreak", repos = "https://cinc.rud.is")
# or
remotes::install_git("https://git.rud.is/hrbrmstr/daybreak.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/daybreak")
# or
remotes::install_gitlab("hrbrmstr/daybreak")
# or
remotes::install_bitbucket("hrbrmstr/daybreak")
# or
remotes::install_github("hrbrmstr/daybreak")
NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.
Usage
library(daybreak)
# current version
packageVersion("daybreak")
## [1] '0.1.0'
Near me:
day_length("2019-12-31", -70.8636, 43.2683)
## [1] 9.031444
day_civil_twilight_length("2019-12-31", -70.8636, 43.2683)
## [1] 10.10834
day_nautical_twilight_length("2019-12-31", -70.8636, 43.2683)
## [1] 11.30569
day_astronomical_twilight_length("2019-12-31", -70.8636, 43.2683)
## [1] 12.45998
sun_rise_set("2019-12-31", -70.8636, 43.2683)
## $rise
## [1] 12.25761
##
## $set
## [1] 21.28906
civil_twilight("2019-12-31", -70.8636, 43.2683)
## $start
## [1] 11.71917
##
## $end
## [1] 21.82751
nautical_twilight("2019-12-31", -70.8636, 43.2683)
## $start
## [1] 11.12049
##
## $end
## [1] 22.42618
astronomical_twilight("2019-12-31", -70.8636, 43.2683)
## $start
## [1] 10.54335
##
## $end
## [1] 23.00332
Tromsø, Norway (Winter)
day_length("2019-12-31", 18.9553, 69.6492)
## [1] 0
day_civil_twilight_length("2019-12-31", 18.9553, 69.6492)
## [1] 4.613116
day_nautical_twilight_length("2019-12-31", 18.9553, 69.6492)
## [1] 8.000323
day_astronomical_twilight_length("2019-12-31", 18.9553, 69.6492)
## [1] 10.5871
sun_rise_set("2019-12-31", 18.9553, 69.6492)
## $rise
## [1] NA
##
## $set
## [1] NA
civil_twilight("2019-12-31", 18.9553, 69.6492)
## $start
## [1] 8.476866
##
## $end
## [1] 13.08998
nautical_twilight("2019-12-31", 18.9553, 69.6492)
## $start
## [1] 6.783262
##
## $end
## [1] 14.78359
astronomical_twilight("2019-12-31", 18.9553, 69.6492)
## $start
## [1] 5.489872
##
## $end
## [1] 16.07698
Tromsø, Norway (Summer)
day_length("2019-06-01", 18.9553, 69.6492)
## [1] 24
day_civil_twilight_length("2019-06-01", 18.9553, 69.6492)
## [1] 24
day_nautical_twilight_length("2019-06-01", 18.9553, 69.6492)
## [1] 24
day_astronomical_twilight_length("2019-06-01", 18.9553, 69.6492)
## [1] 24
sun_rise_set("2019-06-01", 18.9553, 69.6492)
## $rise
## [1] NA
##
## $set
## [1] NA
civil_twilight("2019-06-01", 18.9553, 69.6492)
## $start
## [1] NA
##
## $end
## [1] NA
nautical_twilight("2019-06-01", 18.9553, 69.6492)
## $start
## [1] NA
##
## $end
## [1] NA
astronomical_twilight("2019-06-01", 18.9553, 69.6492)
## $start
## [1] NA
##
## $end
## [1] NA
daybreak Metrics
Lang | # Files | (%) | LoC | (%) | Blank lines | (%) | # Lines | (%) |
---|---|---|---|---|---|---|---|---|
C | 3 | 0.33 | 267 | 0.66 | 110 | 0.60 | 245 | 0.60 |
R | 4 | 0.44 | 65 | 0.16 | 16 | 0.09 | 84 | 0.20 |
C/C++ Header | 1 | 0.11 | 39 | 0.10 | 35 | 0.19 | 44 | 0.11 |
Rmd | 1 | 0.11 | 32 | 0.08 | 21 | 0.12 | 37 | 0.09 |
Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.