APOD: Print astronomy picture of the day

Description Usage Arguments Value Examples

View source: R/APOD.R

Description

The function helps print out an stronomy picture of the day. Each day a different image or photograph of our fascinating universe is featured, along with a brief explanation written by a professional astronomer.

Usage

1
2
APOD(key = Sys.getenv("NASA_TOKEN"), date = Sys.Date(), hd = FALSE,
  return_text = FALSE, download_filename = "img.jpg")

Arguments

key

String. Your NASA API key, you can enter your key directly in the function parameter, but it's not recommended. Instead, you'd better save your key in R environment and call it "NASA_TOKEN". Then the function would automatically acquire your key info.

date

Date. The date("YYYY-MM-DD") of the APOD image to retrieve. Today as default.

hd

Boolean. Retrieve the URL for the high resolution image. Not allowable if it is a video. False as default.

return_text

Boolean. Return the explanation of the image. False as default.

download_filename

String. Filename of downloaded image. Not allowable if it is a video. "img.jpg" as default.

Value

An astronomy picture(hd or not) of the day (can be downloaded) or a video (return the video website).

Examples

1
2
APOD()
APOD(date = as.Date("2019-11-01"), hd = TRUE, return_text = TRUE)

Liu-Zhichao/nasaR documentation built on Dec. 16, 2019, 10:48 p.m.