The purpose of this API is to return how many people are in space, what spacecraft they are on, and their names.
The Code below uses an endpoint defined by NASA to access information about people currently in space.
#defining the endpoint
nasaEnd <- "http://api.open-notify.org/astros.json"
These chunks below first grab the endpoint, then use that endpoint to create a data frame.
nasaAPiGet <-
paste(nasaEnd)
nasa_data <-
nasaAPiGet %>%
eval() %>%
fromJSON()
This call to the NASA API outputs a detailed graph of the persons name and what craft they are on. This uses the data frame created above.
nasa_data %>%
extract2(2)
## name craft
## 1 Jasmin Moghbeli ISS
## 2 Andreas Mogensen ISS
## 3 Satoshi Furukawa ISS
## 4 Konstantin Borisov ISS
## 5 Oleg Kononenko ISS
## 6 Nikolai Chub ISS
## 7 Loral O'Hara ISS