moon.info: Moon phase based on a date

View source: R/moon.info.R

moon.infoR Documentation

Moon phase based on a date

Description

The script gives an index (base 100) that represents moon phase.
If the return value (from 0 to 100) is between:
0 and 1.6931595 or 98.3068405 and 100, it is full moon,
23.3068405 and 26.6931595, last quarter,
48.3068405 and 51.6931595, new moon,
73.3068405 and 76.6931595, first quarter
When phase is set to TRUE, a character representing the moon phase is returned.

Usage

moon.info(date = Sys.Date(), phase = FALSE)

Arguments

date

A date in class Date. By default, it will use today date

phase

If TRUE, a vector of characters with NM, FQ, FL LQ will be returned

Details

moon.info calculates the moon phase based on a date.

Value

Return a value describing the moon phase:
0 and 100 are full moon, 50 is new moon, 25 last quarter and 75 first quater

Author(s)

Marc Girondot marc.girondot@gmail.com

See Also

Other Periodic patterns of indices: index.periodic(), minmax.periodic(), sun.info(), tide.info()

Examples

## Not run: 
library("HelpersMG")
moon.info(as.Date("2001-12-31"))
moon.info(as.Date("14/04/2010", "%d/%m/%Y"))
moon.info(as.Date("22/06/07", "%d/%m/%y"))
moon.info(seq(from=as.Date("2012-03-01"), 
	to=as.Date("2012-04-15"), by="days"))
moon.info(seq(from=as.Date("2012-03-01"), 
		to=as.Date("2012-04-15"), by="days"), phase=TRUE)

## End(Not run)

HelpersMG documentation built on Sept. 12, 2024, 9:35 a.m.