View source: R/get_mars_rover_photos_and_metadata.R
get_mars_rover_photos_and_metadata | R Documentation |
Queries NASA's Mars Rover Photos API to retrieve photos taken by a specified rover on a given Earth date. Optionally saves the images to a folder on the user's Desktop.
get_mars_rover_photos_and_metadata(
rover,
earth_date,
api_key = "DEMO_KEY",
folder_name = NULL
)
rover |
Character. The name of the Mars rover. Must be one of the following:
|
earth_date |
Character. The Earth date to query in |
api_key |
Character. NASA API key. Defaults to |
folder_name |
Character or NULL. If provided, images will be saved in a folder with this name on the user's Desktop. If NULL, images are only displayed and not saved. |
The function prints each retrieved image and associated metadata to the console. If a folder name is specified, images are saved to the Desktop inside the given folder. Only images taken on the specified date are returned; if no images exist, the function stops with an error.
A data frame containing metadata about the retrieved photos, including photo ID, sol (Martian day), camera name, image source URL, Earth date, and rover name.
## Not run:
# Retrieve and save photos taken by Curiosity on June 3, 2015
mars_photos_metadata <- get_mars_rover_photos_and_metadata(
rover = "curiosity",
earth_date = "2015-06-03",
api_key = "DEMO_KEY",
folder_name = "MarsPhotos"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.