|
1 | 1 | --- |
2 | 2 | title: "Fetching JSON data from REST APIs" |
3 | | -date: "2020-06-24" |
| 3 | +date: "2020-06-25" |
4 | 4 | output: |
5 | 5 | html_document |
6 | 6 | vignette: > |
@@ -214,34 +214,6 @@ subset(category1, select = c("author", "title", "publisher")) |
214 | 214 | 5 David Baldacci THE FORGOTTEN Grand Central Publishing |
215 | 215 | ``` |
216 | 216 |
|
217 | | -```r |
218 | | -#movie reviews |
219 | | -movie_key <- "&api-key=b75da00e12d54774a2d362adddcc9bef" |
220 | | -url <- "http://api.nytimes.com/svc/movies/v2/reviews/dvd-picks.json?order=by-date" |
221 | | -req <- fromJSON(paste0(url, movie_key)) |
222 | | -``` |
223 | | - |
224 | | -``` |
225 | | -Error in open.connection(con, "rb"): HTTP error 401. |
226 | | -``` |
227 | | - |
228 | | -```r |
229 | | -reviews <- req$results |
230 | | -colnames(reviews) |
231 | | -``` |
232 | | - |
233 | | -``` |
234 | | -NULL |
235 | | -``` |
236 | | - |
237 | | -```r |
238 | | -reviews[1:5, c("display_title", "byline", "mpaa_rating")] |
239 | | -``` |
240 | | - |
241 | | -``` |
242 | | -Error in reviews[1:5, c("display_title", "byline", "mpaa_rating")]: incorrect number of dimensions |
243 | | -``` |
244 | | - |
245 | 217 | ## Twitter |
246 | 218 |
|
247 | 219 | The twitter API requires OAuth2 authentication. Some example code: |
@@ -275,14 +247,14 @@ substring(tweets$text, 1, 100) |
275 | 247 | ``` |
276 | 248 |
|
277 | 249 | ``` |
278 | | - [1] "Estimating Group Differences in Network Models using Moderation {https://t.co/3ViArl9OZ2} #rstats #" |
279 | | - [2] "Deep attractors: Where deep learning meets chaos {https://t.co/u3HniDkjWw} #rstats #DataScience" |
280 | | - [3] "R Communities in South Africa {https://t.co/cRBfDMPtBE} #rstats #DataScience" |
281 | | - [4] "Interactively perform a spatial interpolation with the GUInterp Shiny interface {https://t.co/jzidD" |
282 | | - [5] "Advanced Modelling in R with CARET – a focus on supervised machine learning {https://t.co/TSQtoxWrb" |
283 | | - [6] "Color Bars {https://t.co/HJ2Ip24rnb} #rstats #DataScience" |
284 | | - [7] "Why R? Webinar – Neural Networks for Modelling Molecular Interactions with Tensorflow {https://t.co" |
285 | | - [8] "COVID-19: False Positive Alarm {https://t.co/0ufxeYAPQc} #rstats #DataScience" |
286 | | - [9] "#27: R and CRAN Binaries for Ubuntu {https://t.co/yi5Xi9xQT9} #rstats #DataScience" |
287 | | -[10] "Consider a permutation test for a small pilot study {https://t.co/oe6Lz4uSHi} #rstats #DataScience" |
| 250 | + [1] "https://t.co/Jac2KxZJkv in R: How to Make a Computer Vision Model within an R Environment {https://" |
| 251 | + [2] "Estimating Group Differences in Network Models using Moderation {https://t.co/3ViArl9OZ2} #rstats #" |
| 252 | + [3] "Deep attractors: Where deep learning meets chaos {https://t.co/u3HniDkjWw} #rstats #DataScience" |
| 253 | + [4] "R Communities in South Africa {https://t.co/cRBfDMPtBE} #rstats #DataScience" |
| 254 | + [5] "Interactively perform a spatial interpolation with the GUInterp Shiny interface {https://t.co/jzidD" |
| 255 | + [6] "Advanced Modelling in R with CARET – a focus on supervised machine learning {https://t.co/TSQtoxWrb" |
| 256 | + [7] "Color Bars {https://t.co/HJ2Ip24rnb} #rstats #DataScience" |
| 257 | + [8] "Why R? Webinar – Neural Networks for Modelling Molecular Interactions with Tensorflow {https://t.co" |
| 258 | + [9] "COVID-19: False Positive Alarm {https://t.co/0ufxeYAPQc} #rstats #DataScience" |
| 259 | +[10] "#27: R and CRAN Binaries for Ubuntu {https://t.co/yi5Xi9xQT9} #rstats #DataScience" |
288 | 260 | ``` |
0 commit comments