JosiahParry / opensecrets

An OpenSecrets API wrapper for R
7 stars 0 forks source link

add status code stops #4

Closed jimrothstein closed 4 years ago

jimrothstein commented 4 years ago

I always get tripped up getting json into tibble form.

Believe in some places you used purrr::pluck() and in others this kind of chain: res$response$contributors....

Again, neutral but do find pluck helpful and also helpful to document for your "future self" to decipher api navigation.

Also suggest httr::stop_for_status() to catch an errors from the GET calls.

JosiahParry commented 4 years ago

pluck retrieves elements from a list. It is the same as using list[[item_i]][[item_j]]. They all function the same.

The use of res$.... inside of a mutate was strictly for minimizing of characters :)

Please institute a stop_for_status() if you're willing.

jimrothstein commented 4 years ago

stop_for_status() Adding this today (Tuesday)