File: year.R

package info (click to toggle)
r-cran-units 0.8-1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,068 kB
  • sloc: xml: 2,437; cpp: 175; sh: 13; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 737 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# demo illustrating the different year lengths, as available in
# NISTunits:
library(NISTunits)
options(digits=7)
NISTyearTOsec(1) / (24 * 3600) # number of mean solar days days in 1 common Gregorian year
NISTyearTropicalTOsec(1) / (24 * 3600) # number of mean solar days days in 1 tropical year
NISTyearSiderealTOsec(1) / (24 * 3600) # number of mean solar days days in 1 sidereal year
NISTyearTropicalTOsec(1) / (24 * 3600) # number of mean solar days days in 1 tropical year
NISTyearSiderealTOsec(1) / (24 * 3600) # number of mean solar days days in 1 sidereal year

# ... and in udunits2:
library(units)
as_units("common_year")
as_units("leap_year")
as_units("Gregorian_year")
as_units("Julian_year")
as_units("yr") # yr = tropical: