zodiac: Get zodiac (corresponding to date x).

View source: R/time_fun.R

zodiacR Documentation

Get zodiac (corresponding to date x).

Description

zodiac provides the tropical zodiac sign or symbol for given date(s) x.

Usage

zodiac(
  x,
  out = "en",
  zodiac_swap_mmdd = c(120, 219, 321, 421, 521, 621, 723, 823, 923, 1023, 1123, 1222)
)

Arguments

x

Date (as a scalar or vector, required). If x is not a date (of class "Date"), the function tries to coerce x into a "Date".

out

Output format (as character). Available output formats are: English/Latin (out = "en", by default), German/Deutsch (out = "de"), HTML (out = "html"), or Unicode (out = "Unicode") symbols.

zodiac_swap_mmdd

Monthly dates on which the 12 zodiac signs switch (in mmdd format, ordered chronologically within a calendar year). Default: zodiac_swap_mmdd = c(0120, 0219, 0321, 0421, 0521, 0621, 0723, 0823, 0923, 1023, 1123, 1222).

Details

zodiac is flexible by providing different output formats (in Latin/English, German, or Unicode/HTML, see out) and allowing to adjust the calendar dates on which a new zodiac is assigned (via zodiac_swap_mmdd).

Value

Zodiac label or symbol (as a factor).

Source

See https://en.wikipedia.org/wiki/Zodiac or https://de.wikipedia.org/wiki/Tierkreiszeichen for alternative date ranges.

See Also

Zodiac() function of the DescTools package.

Other date and time functions: change_time(), change_tz(), cur_date(), cur_time(), days_in_month(), diff_dates(), diff_times(), diff_tz(), is_leap_year(), what_date(), what_month(), what_time(), what_wday(), what_week(), what_year()

Examples

zodiac(Sys.Date())

# Works with vectors:
dt <- sample_date(size = 10)
zodiac(dt)
levels(zodiac(dt))

# Alternative outputs:
zodiac(dt, out = "de")  # German/deutsch
zodiac(dt, out = "Unicode")  # Unicode
zodiac(dt, out = "HTML")     # HTML

# Alternative date breaks:
zodiac("2000-08-23")  # 0823 is "Virgo" by default
zodiac("2000-08-23",  # change to 0824 (i.e., August 24): 
       zodiac_swap_mmdd = c(0120, 0219, 0321, 0421, 0521, 0621, 
                            0723, 0824, 0923, 1023, 1123, 1222))


ds4psy documentation built on Sept. 15, 2023, 9:08 a.m.