R/add_planet.R

Defines functions add_planet

add_planet <-
function(time, labels = TRUE, ...) {
  labs <- c("Sun", "Moon", "Mercury", "Venus", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto")
  position <- planets(time)
  points(position[, 1], position[, 2], ...)
  if (labels) {
    text(position[, 1], position[, 2] + 5, labs, cex = 1.2)
  }
  return(position)
}
helixcn/ephem documentation built on March 31, 2021, 5:45 a.m.