Learn R Programming

rwars (version 1.0.0)

get_planet: Retrieve Data about a Specific DB Entry

Description

These functions return a specific DB entry's information - where that entry can be a planet, species, vehicle, so on and so forth.

Usage

get_planet(id, parse_result = FALSE, ...)
get_species(id, parse_result = FALSE, ...)
get_film(id, parse_result = FALSE, ...)
get_vehicle(id, parse_result = FALSE, ...)
get_starship(id, parse_result = FALSE, ...)
get_person(id, parse_result = FALSE, ...)

Arguments

id
the numeric ID of the (planet, species, etc) you want to retrieve. Note that IDs are not necessarily sequential; IDs 3, 4 and 6 may exist, while ID 5 may error.
parse_result
whether to parse and simplify the data before returning it. Set to FALSE by default.
...
further arguments to pass to httr's GET function.

See Also

retrieving entire classes of entries with all_entries.

Examples

Run this code
#Retrieve an object by ID
looking_for_data_in_alderaan_places <- get_planet(2)

Run the code above in your browser using DataLab