From c6a68c51f22faaafaf63d7805e78371d3117203a Mon Sep 17 00:00:00 2001 From: nfrerebeau Date: Wed, 13 Nov 2024 12:13:18 +0100 Subject: [PATCH] Add conversion methods --- R/calendar-gregorian.R | 132 +++++++++++++++++++++++++-- R/calendar-julian.R | 122 +++++++++++++++++++++++-- R/rd.R | 90 ------------------- R/year.R | 160 ++++++++------------------------- inst/tinytest/test_gregorian.R | 2 +- inst/tinytest/test_julian.R | 13 ++- man/as_date.Rd | 9 +- man/as_decimal.Rd | 7 +- man/as_year.Rd | 9 +- man/fixed.Rd | 6 +- 10 files changed, 308 insertions(+), 242 deletions(-) delete mode 100644 R/rd.R diff --git a/R/calendar-gregorian.R b/R/calendar-gregorian.R index 29566e3..666c2c5 100644 --- a/R/calendar-gregorian.R +++ b/R/calendar-gregorian.R @@ -14,6 +14,129 @@ setMethod( } ) +# Fixed from Gregorian ========================================================= +#' @export +#' @rdname fixed +#' @aliases fixed,numeric,missing,missing,GregorianCalendar-method +setMethod( + f = "fixed", + signature = c(year = "numeric", month = "missing", day = "missing", calendar = "GregorianCalendar"), + definition = function(year, calendar, scale = 1) { + ## Rescale to years (if not already) + year <- year * scale + + rd <- fixed(year, 01, 01, calendar = calendar) + + is_leap <- which(is_gregorian_leap_year(year)) + rd[is_leap] <- ceiling(rd[is_leap]) # WHY ??? + rd + } +) + +#' @export +#' @rdname fixed +#' @aliases fixed,numeric,numeric,numeric,GregorianCalendar-method +setMethod( + f = "fixed", + signature = c(year = "numeric", month = "numeric", day = "numeric", calendar = "GregorianCalendar"), + definition = function(year, month, day, calendar) { + ## Recycle + n <- length(year) + if (n > 1) { + if (length(month) == 1) month <- rep(month, n) + if (length(day) == 1) day <- rep(day, n) + } + + ## Switch origin + year <- (year - calendar_epoch(calendar)) * calendar_direction(calendar) + + ## Correct for 28- or 29-day Feb + correction <- rep(-2, length(year)) + correction[is_gregorian_leap_year(year)] <- -1 + correction[month <= 2] <- 0 + + rd <- calendar_fixed(calendar) - 1 + # Days before start of calendar + 365 * (year - 1) + # Ordinary days since epoch + (year - 1) %/% 4 - # Julian leap days since epoch minus... + (year - 1) %/% 100 + # ...century years since epoch plus... + (year - 1) %/% 400 + # ...years since epoch divisible by 400 + (367 * month - 362) %/% 12 + # Days in prior months this year assuming 30-day Feb + correction + # Correct for 28- or 29-day Feb + day # Days so far this month. + + ## Fix infinite values + rd[is.infinite(year)] <- year[is.infinite(year)] + + .RataDie(rd) + } +) +# Gregorian from fixed ========================================================= +#' @export +#' @rdname as_year +#' @aliases as_year,numeric,GregorianCalendar-method +setMethod( + f = "as_year", + signature = c(object = "numeric", calendar = "GregorianCalendar"), + definition = function(object, calendar, decimal = TRUE, ...) { + d0 <- object - calendar_fixed(calendar) + n400 <- d0 %/% 146097 + d1 <- d0 %% 146097 + n100 <- d1 %/% 36524 + d2 <- d1 %% 36524 + n4 <- d2 %/% 1461 + d3 <- d2 %% 1461 + n1 <- d3 %/% 365 + + year <- 400 * n400 + 100 * n100 + 4 * n4 + n1 + year <- ifelse(n100 == 4 | n1 == 4, year, year + 1) + + ## Shift origin + year <- (year - calendar_epoch(calendar)) * calendar_direction(calendar) + + if (isTRUE(decimal)) { + ## Year length in days + start <- fixed(year, 01, 01, calendar = calendar) + end <- fixed(year, 12, 31, calendar = calendar) + total <- end - start + 1 + + ## Elapsed time + sofar <- object - start + + year <- year + sofar / total + } + + ## Fix infinite values + year[is.infinite(object)] <- object[is.infinite(object)] + + year + } +) + +#' @export +#' @rdname as_date +#' @aliases as_date,numeric,GregorianCalendar-method +setMethod( + f = "as_date", + signature = c(object = "numeric", calendar = "GregorianCalendar"), + definition = function(object, calendar) { + year <- as_year(object, calendar = calendar, decimal = FALSE) + prior_days <- object - fixed(year, 01, 01, calendar = calendar) + + correction <- rep(2, length(object)) + correction[object < fixed(year, 03, 01, calendar = calendar)] <- 0 + correction[is_gregorian_leap_year(year)] <- 1 + + month <- (12 * (prior_days + correction) + 373) %/% 367 + day <- object - fixed(year, month, 01, calendar = calendar) + 1 + + data.frame( + year = as.numeric(year), + month = as.numeric(month), + day = as.numeric(day) + ) + } +) + # Era ========================================================================== #' @export #' @rdname fixed_gregorian @@ -86,12 +209,3 @@ fixed_from_b2k <- function(year, month, day) { fixed_to_b2k <- function(object) { as_year(object, calendar = b2k(), decimal = TRUE) } - -# Helpers ====================================================================== -is_gregorian_leap_year <- function(year) { - year <- floor(year) # Drop decimal part (if any) - ((year %% 4) == 0) & - (year %% 400 != 100) & - (year %% 400 != 200) & - (year %% 400 != 300) -} diff --git a/R/calendar-julian.R b/R/calendar-julian.R index 3bd77b1..b6165ef 100644 --- a/R/calendar-julian.R +++ b/R/calendar-julian.R @@ -2,7 +2,7 @@ #' @include AllGenerics.R NULL -# Juliab calendar ============================================================== +# Julian calendar ============================================================== #' @export #' @rdname is #' @aliases is_julian,ANY-method @@ -14,6 +14,117 @@ setMethod( } ) +# Fixed from Julian ============================================================ +#' @export +#' @rdname fixed +#' @aliases fixed,numeric,missing,missing,JulianCalendar-method +setMethod( + f = "fixed", + signature = c(year = "numeric", month = "missing", day = "missing", calendar = "JulianCalendar"), + definition = function(year, calendar, scale = 1) { + ## Rescale to years (if not already) + year <- year * scale + + rd <- fixed(year, 01, 01, calendar = calendar) + + is_leap <- which(is_julian_leap_year(year)) + rd[is_leap] <- ceiling(rd[is_leap]) # WHY ??? + rd + } +) + +#' @export +#' @rdname fixed +#' @aliases fixed,numeric,numeric,numeric,JulianCalendar-method +setMethod( + f = "fixed", + signature = c(year = "numeric", month = "numeric", day = "numeric", calendar = "JulianCalendar"), + definition = function(year, month, day, calendar) { + ## Validation + if (any(year == 0)) { + stop(tr_("There is no year zero in the Julian calendar."), call. = FALSE) + } + + ## Correct for 28- or 29-day Feb + correction <- rep(-2, length(year)) + correction[which(is_julian_leap_year(year))] <- -1 + correction[month <= 2] <- 0 + + ## There is no year 0 on the Julian calendar + year[year < 0] <- year[year < 0] + 1 + + rd <- calendar_fixed(calendar) - 1 + # Days before start of calendar + 365 * (year - 1) + # Ordinary days since epoch + (year - 1) %/% 4 + # Leap days since epoch + (367 * month - 362) %/% 12 + # Days in prior months this year assuming 30-day Feb + correction + # Correct for 28- or 29-day Feb + day # Days so far this month. + + ## Fix infinite values + rd[is.infinite(year)] <- year[is.infinite(year)] + + .RataDie(rd) + } +) + +# Julian from fixed ============================================================ +#' @export +#' @rdname as_year +#' @aliases as_year,numeric,JulianCalendar-method +setMethod( + f = "as_year", + signature = c(object = "numeric", calendar = "JulianCalendar"), + definition = function(object, calendar, decimal = FALSE, ...) { + d0 <- object - calendar_fixed(calendar) + year <- (4 * d0 + 1464) %/% 1461 + + ## There is no year 0 on the Julian calendar + year[year <= 0] <- year[year <= 0] - 1 + + if (isTRUE(decimal)) { + ## Year length in days + start <- fixed(year, 01, 01, calendar = calendar) + end <- fixed(year, 12, 31, calendar = calendar) + total <- end - start + 1 + + ## Elapsed time + sofar <- object - start + + year <- year + sofar / total + } + + ## Fix infinite values + year[is.infinite(object)] <- object[is.infinite(object)] + + unclass(year) + } +) + +#' @export +#' @rdname as_date +#' @aliases as_date,numeric,JulianCalendar-method +setMethod( + f = "as_date", + signature = c(object = "numeric", calendar = "JulianCalendar"), + definition = function(object, calendar) { + year <- as_year(object, calendar = calendar, decimal = FALSE) + prior_days <- object - fixed(year, 01, 01, calendar = calendar) + + correction <- rep(2, length(object)) + correction[object < fixed(year, 03, 01, calendar = calendar)] <- 0 + correction[is_julian_leap_year(year)] <- 1 + + month <- (12 * (prior_days + correction) + 373) %/% 367 + day <- object - fixed(year, month, 01, calendar = calendar) + 1 + + data.frame( + year = unclass(year), + month = unclass(month), + day = unclass(day) + ) + } +) + # Era ========================================================================== #' @export #' @rdname fixed_julian @@ -21,16 +132,9 @@ fixed_from_julian <- function(year, month, day) { if (missing(month) || missing(day)) fixed(year, calendar = J()) else fixed(year, month, day, calendar = J()) } + #' @export #' @rdname fixed_julian fixed_to_julian <- function(object) { as_year(object, calendar = J()) } - -# Helpers ====================================================================== -is_julian_leap_year <- function(year) { - year <- floor(year) # Drop decimal part (if any) - leap <- year %% 4 == 3 - leap[year > 0] <- year[year > 0] %% 4 == 0 - leap -} diff --git a/R/rd.R b/R/rd.R deleted file mode 100644 index 703ae86..0000000 --- a/R/rd.R +++ /dev/null @@ -1,90 +0,0 @@ -# RATA DIE -#' @include AllGenerics.R -NULL - -# Fixed from Gregorian ========================================================= -#' @export -#' @rdname fixed -#' @aliases fixed,numeric,missing,missing,GregorianCalendar-method -setMethod( - f = "fixed", - signature = c(year = "numeric", month = "missing", day = "missing", calendar = "GregorianCalendar"), - definition = function(year, calendar, scale = 1) { - ## Rescale to years (if not already) - year <- year * scale - - rd <- fixed(year, 01, 01, calendar = calendar) - - is_leap <- which(is_gregorian_leap_year(year)) - rd[is_leap] <- ceiling(rd[is_leap]) # WHY ??? - rd - } -) - -#' @export -#' @rdname fixed -#' @aliases fixed,numeric,numeric,numeric,GregorianCalendar-method -setMethod( - f = "fixed", - signature = c(year = "numeric", month = "numeric", day = "numeric", calendar = "GregorianCalendar"), - definition = function(year, month, day, calendar) { - ## Recycle - n <- length(year) - if (n > 1) { - if (length(month) == 1) month <- rep(month, n) - if (length(day) == 1) day <- rep(day, n) - } - - ## Switch origin - year <- (year - calendar_epoch(calendar)) * calendar_direction(calendar) - - ## Correct for 28- or 29-day Feb - correction <- rep(-2, length(year)) - correction[is_gregorian_leap_year(year)] <- -1 - correction[month <= 2] <- 0 - - rd <- calendar_fixed(calendar) - 1 + # Days before start of calendar - 365 * (year - 1) + # Ordinary days since epoch - (year - 1) %/% 4 - # Julian leap days since epoch minus... - (year - 1) %/% 100 + # ...century years since epoch plus... - (year - 1) %/% 400 + # ...years since epoch divisible by 400 - (367 * month - 362) %/% 12 + # Days in prior months this year assuming 30-day Feb - correction + # Correct for 28- or 29-day Feb - day # Days so far this month. - - ## Fix infinite values - rd[is.infinite(year)] <- year[is.infinite(year)] - - .RataDie(rd) - } -) - -# Fixed from Julian ============================================================ -#' @export -#' @rdname fixed -#' @aliases fixed,numeric,numeric,numeric,JulianCalendar-method -setMethod( - f = "fixed", - signature = c(year = "numeric", month = "numeric", day = "numeric", calendar = "JulianCalendar"), - definition = function(year, month, day, calendar) { - ## Correct for 28- or 29-day Feb - correction <- rep(-2, length(year)) - correction[which(is_julian_leap_year(year))] <- -1 - correction[month <= 2] <- 0 - - ## There is no year 0 on the Julian calendar - year[year < 0] <- year[year < 0] + 1 - - rd <- calendar_fixed(calendar) - 1 + # Days before start of calendar - 365 * (year - 1) + # Ordinary days since epoch - (year - 1) %/% 4 + # Leap days since epoch - (367 * month - 362) %/% 12 + # Days in prior months this year assuming 30-day Feb - correction + # Correct for 28- or 29-day Feb - day # Days so far this month. - - ## Fix infinite values - rd[is.infinite(year)] <- year[is.infinite(year)] - - .RataDie(rd) - } -) diff --git a/R/year.R b/R/year.R index 587feb4..bc7eb9d 100644 --- a/R/year.R +++ b/R/year.R @@ -2,139 +2,57 @@ #' @include AllGenerics.R NULL -# JulianCalendar =============================================================== -#' @export -#' @rdname as_year -#' @aliases as_year,numeric,JulianCalendar-method -setMethod( - f = "as_year", - signature = c(object = "numeric", calendar = "JulianCalendar"), - definition = function(object, calendar, ...) { - d0 <- object - calendar_fixed(calendar) - year <- (4 * d0 + 1464) %/% 1461 - - ## There is no year 0 on the Julian calendar - year[year <= 0] <- year[year <= 0] - 1 - - ## Fix infinite values - year[is.infinite(object)] <- object[is.infinite(object)] - - unclass(year) - } -) - -#' @export -#' @rdname as_date -#' @aliases as_date,numeric,JulianCalendar-method -setMethod( - f = "as_date", - signature = c(object = "numeric", calendar = "JulianCalendar"), - definition = function(object, calendar) { - year <- as_year(object, calendar = calendar) - prior_days <- object - fixed(year, 01, 01, calendar = calendar) - - correction <- rep(2, length(object)) - correction[object < fixed(year, 03, 01, calendar = calendar)] <- 0 - correction[is_julian_leap_year(year)] <- 1 - - month <- (12 * (prior_days + correction) + 373) %/% 367 - day <- object - fixed(year, month, 01, calendar = calendar) + 1 - - data.frame( - year = unclass(year), - month = unclass(month), - day = unclass(day) - ) - } -) - -# GregorianCalendar ============================================================ +# Decimal years ================================================================ #' @export -#' @rdname as_year -#' @aliases as_year,numeric,GregorianCalendar-method +#' @rdname as_decimal +#' @aliases as_decimal,numeric,numeric,numeric,GregorianCalendar-method setMethod( - f = "as_year", - signature = c(object = "numeric", calendar = "GregorianCalendar"), - definition = function(object, calendar, decimal = TRUE, ...) { - d0 <- object - calendar_fixed(calendar) - n400 <- d0 %/% 146097 - d1 <- d0 %% 146097 - n100 <- d1 %/% 36524 - d2 <- d1 %% 36524 - n4 <- d2 %/% 1461 - d3 <- d2 %% 1461 - n1 <- d3 %/% 365 - - year <- 400 * n400 + 100 * n100 + 4 * n4 + n1 - year <- ifelse(n100 == 4 | n1 == 4, year, year + 1) - + f = "as_decimal", + signature = c(year = "numeric", month = "numeric", day = "numeric", calendar = "GregorianCalendar"), + definition = function(year, month, day, calendar) { ## Shift origin year <- (year - calendar_epoch(calendar)) * calendar_direction(calendar) - if (isTRUE(decimal)) { - ## Year length in days - start <- fixed(year, 01, 01, calendar = calendar) - end <- fixed(year, 12, 31, calendar = calendar) - total <- end - start + 1 - - ## Elapsed time - sofar <- object - start - - year <- year + sofar / total - } - - ## Fix infinite values - year[is.infinite(object)] <- object[is.infinite(object)] - - year - } -) - -#' @export -#' @rdname as_date -#' @aliases as_date,numeric,GregorianCalendar-method -setMethod( - f = "as_date", - signature = c(object = "numeric", calendar = "GregorianCalendar"), - definition = function(object, calendar) { - year <- as_year(object, calendar = calendar, decimal = FALSE) - prior_days <- object - fixed(year, 01, 01, calendar = calendar) - - correction <- rep(2, length(object)) - correction[object < fixed(year, 03, 01, calendar = calendar)] <- 0 - correction[is_gregorian_leap_year(year)] <- 1 - - month <- (12 * (prior_days + correction) + 373) %/% 367 - day <- object - fixed(year, month, 01, calendar = calendar) + 1 - - data.frame( - year = as.numeric(year), - month = as.numeric(month), - day = as.numeric(day) - ) + .as_decimal(year, month, day, calendar) } ) -# Decimal years ================================================================ #' @export #' @rdname as_decimal -#' @aliases as_decimal,numeric,numeric,numeric,TimeScale-method +#' @aliases as_decimal,numeric,numeric,numeric,JulianCalendar-method setMethod( f = "as_decimal", - signature = c(year = "numeric", month = "numeric", day = "numeric", calendar = "TimeScale"), + signature = c(year = "numeric", month = "numeric", day = "numeric", calendar = "JulianCalendar"), definition = function(year, month, day, calendar) { - ## Shift origin - year <- (year - calendar_epoch(calendar)) * calendar_direction(calendar) - - ## Year length in days - start <- fixed(year, 01, 01, calendar = calendar) - end <- fixed(year, 12, 31, calendar = calendar) - total <- end - start + 1 - - ## Elapsed time - date <- fixed(year, month, day, calendar = calendar) - sofar <- date - start - - unclass(year + sofar / total) + .as_decimal(year, month, day, calendar) } ) + +.as_decimal <- function(year, month, day, calendar) { + ## Year length in days + start <- fixed(year, 01, 01, calendar = calendar) + end <- fixed(year, 12, 31, calendar = calendar) + total <- end - start + 1 + + ## Elapsed time + date <- fixed(year, month, day, calendar = calendar) + sofar <- date - start + + unclass(year + sofar / total) +} + +# Leap year ==================================================================== +is_julian_leap_year <- function(year) { + year <- floor(year) # Drop decimal part (if any) + leap <- year %% 4 == 3 + leap[year > 0] <- year[year > 0] %% 4 == 0 + leap +} + +is_gregorian_leap_year <- function(year) { + year <- floor(year) # Drop decimal part (if any) + ((year %% 4) == 0) & + (year %% 400 != 100) & + (year %% 400 != 200) & + (year %% 400 != 300) +} diff --git a/inst/tinytest/test_gregorian.R b/inst/tinytest/test_gregorian.R index fecef1a..c43da39 100644 --- a/inst/tinytest/test_gregorian.R +++ b/inst/tinytest/test_gregorian.R @@ -30,7 +30,7 @@ expect_equal(round(as_decimal(2000, 02, 29, calendar = CE()), 9), 2000.161202186 # WHY ??? fix <- fixed(dec, calendar = CE()) -expect_equal(fix, rd) +expect_equal(fix@.Data, as.numeric(dates$rata_die)) expect_equal(as_date(fix, calendar = CE()), target) expect_equal(as_year(fix, calendar = CE(), decimal = FALSE), target$year) expect_equal(as_year(fix, calendar = CE(), decimal = TRUE), dec) diff --git a/inst/tinytest/test_julian.R b/inst/tinytest/test_julian.R index 147e3f4..873f744 100644 --- a/inst/tinytest/test_julian.R +++ b/inst/tinytest/test_julian.R @@ -23,6 +23,17 @@ expect_equal(rd@.Data, as.numeric(dates$rata_die)) expect_equal(as_year(rd, calendar = J()), target$year) expect_equal(as_date(rd, calendar = J()), target) +# Rata die <> Julian decimal year =========================================== +# expect_equal(round(as_decimal(2023, 05, 09, calendar = J()), 9), 2023.350684936) +# expect_equal(round(as_decimal(2000, 02, 29, calendar = J()), 9), 2000.161202186) + +# WHY ??? +fix <- fixed(dec, calendar = J()) +expect_equal(fix@.Data, as.numeric(dates$rata_die)) +expect_equal(as_date(fix, calendar = J()), target) +expect_equal(as_year(fix, calendar = J(), decimal = FALSE), target$year) +expect_equal(as_year(fix, calendar = J(), decimal = TRUE), dec) + # Shortcuts ==================================================================== -expect_equal(fixed_to_julian(fixed_from_AD(01, 01, 01)), 1) +expect_equal(fixed_to_julian(fixed_from_julian(01, 01, 01)), 1) expect_equal(as_date(fixed_from_AD(01, 01, 01), calendar = J()), data.frame(year = 1, month = 1, day = 3)) diff --git a/man/as_date.Rd b/man/as_date.Rd index 73e7ff0..cd9d56d 100644 --- a/man/as_date.Rd +++ b/man/as_date.Rd @@ -1,18 +1,19 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/AllGenerics.R, R/year.R +% Please edit documentation in R/AllGenerics.R, R/calendar-gregorian.R, +% R/calendar-julian.R \docType{methods} \name{as_date} \alias{as_date} \alias{as_date-method} -\alias{as_date,numeric,JulianCalendar-method} \alias{as_date,numeric,GregorianCalendar-method} +\alias{as_date,numeric,JulianCalendar-method} \title{Date Conversion from \emph{Rata Die}} \usage{ as_date(object, calendar) -\S4method{as_date}{numeric,JulianCalendar}(object, calendar) - \S4method{as_date}{numeric,GregorianCalendar}(object, calendar) + +\S4method{as_date}{numeric,JulianCalendar}(object, calendar) } \arguments{ \item{object}{A \code{\linkS4class{RataDie}} object (see \code{\link[=fixed]{fixed()}}).} diff --git a/man/as_decimal.Rd b/man/as_decimal.Rd index 13517ee..7e7a783 100644 --- a/man/as_decimal.Rd +++ b/man/as_decimal.Rd @@ -4,12 +4,15 @@ \name{as_decimal} \alias{as_decimal} \alias{as_decimal-method} -\alias{as_decimal,numeric,numeric,numeric,TimeScale-method} +\alias{as_decimal,numeric,numeric,numeric,GregorianCalendar-method} +\alias{as_decimal,numeric,numeric,numeric,JulianCalendar-method} \title{Converts a Date to a Decimal of its Year} \usage{ as_decimal(year, month, day, calendar) -\S4method{as_decimal}{numeric,numeric,numeric,TimeScale}(year, month, day, calendar) +\S4method{as_decimal}{numeric,numeric,numeric,GregorianCalendar}(year, month, day, calendar) + +\S4method{as_decimal}{numeric,numeric,numeric,JulianCalendar}(year, month, day, calendar) } \arguments{ \item{year}{A \code{\link{numeric}} vector of years. If \code{month} and \code{day} are missing, diff --git a/man/as_year.Rd b/man/as_year.Rd index 02fb4e8..2cb8e55 100644 --- a/man/as_year.Rd +++ b/man/as_year.Rd @@ -1,18 +1,19 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/AllGenerics.R, R/year.R +% Please edit documentation in R/AllGenerics.R, R/calendar-gregorian.R, +% R/calendar-julian.R \docType{methods} \name{as_year} \alias{as_year} \alias{as_year-method} -\alias{as_year,numeric,JulianCalendar-method} \alias{as_year,numeric,GregorianCalendar-method} +\alias{as_year,numeric,JulianCalendar-method} \title{Year Conversion from \emph{Rata Die}} \usage{ as_year(object, calendar, ...) -\S4method{as_year}{numeric,JulianCalendar}(object, calendar, ...) - \S4method{as_year}{numeric,GregorianCalendar}(object, calendar, decimal = TRUE, ...) + +\S4method{as_year}{numeric,JulianCalendar}(object, calendar, decimal = FALSE, ...) } \arguments{ \item{object}{A \code{\linkS4class{RataDie}} object (see \code{\link[=fixed]{fixed()}}).} diff --git a/man/fixed.Rd b/man/fixed.Rd index 2222447..cf0ef19 100644 --- a/man/fixed.Rd +++ b/man/fixed.Rd @@ -1,11 +1,13 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/AllGenerics.R, R/rd.R +% Please edit documentation in R/AllGenerics.R, R/calendar-gregorian.R, +% R/calendar-julian.R \docType{methods} \name{fixed} \alias{fixed} \alias{fixed-method} \alias{fixed,numeric,missing,missing,GregorianCalendar-method} \alias{fixed,numeric,numeric,numeric,GregorianCalendar-method} +\alias{fixed,numeric,missing,missing,JulianCalendar-method} \alias{fixed,numeric,numeric,numeric,JulianCalendar-method} \title{\emph{Rata Die} (Fixed Date)} \usage{ @@ -15,6 +17,8 @@ fixed(year, month, day, calendar, ...) \S4method{fixed}{numeric,numeric,numeric,GregorianCalendar}(year, month, day, calendar) +\S4method{fixed}{numeric,missing,missing,JulianCalendar}(year, calendar, scale = 1) + \S4method{fixed}{numeric,numeric,numeric,JulianCalendar}(year, month, day, calendar) } \arguments{