Skip to content

Commit 17ce99a

Browse files
committed
Remove dead API example
1 parent 544d658 commit 17ce99a

File tree

3 files changed

+12
-49
lines changed

3 files changed

+12
-49
lines changed

vignettes/json-apis.Rmd

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Fetching JSON data from REST APIs"
3-
date: "2020-06-24"
3+
date: "2020-06-25"
44
output:
55
html_document
66
vignette: >
@@ -214,34 +214,6 @@ subset(category1, select = c("author", "title", "publisher"))
214214
5 David Baldacci THE FORGOTTEN Grand Central Publishing
215215
```
216216

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-
245217
## Twitter
246218

247219
The twitter API requires OAuth2 authentication. Some example code:
@@ -275,14 +247,14 @@ substring(tweets$text, 1, 100)
275247
```
276248

277249
```
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"
288260
```

vignettes/json-apis.Rmd.orig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,6 @@ req <- fromJSON(paste0(url, books_key))
106106
bestsellers <- req$results$list
107107
category1 <- bestsellers[[1, "books"]]
108108
subset(category1, select = c("author", "title", "publisher"))
109-
110-
#movie reviews
111-
movie_key <- "&api-key=b75da00e12d54774a2d362adddcc9bef"
112-
url <- "http://api.nytimes.com/svc/movies/v2/reviews/dvd-picks.json?order=by-date"
113-
req <- fromJSON(paste0(url, movie_key))
114-
reviews <- req$results
115-
colnames(reviews)
116-
reviews[1:5, c("display_title", "byline", "mpaa_rating")]
117-
118109
```
119110

120111
## Twitter

vignettes/json-paging.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Combining pages of JSON data with jsonlite"
3-
date: "2020-06-24"
3+
date: "2020-06-25"
44
output:
55
html_document
66
vignette: >

0 commit comments

Comments
 (0)