Skip to content

Instantly share code, notes, and snippets.

@cecilesauder
Created November 21, 2018 15:13
Show Gist options
  • Save cecilesauder/f19002ce3418091ad4dbf771dbd88946 to your computer and use it in GitHub Desktop.
Save cecilesauder/f19002ce3418091ad4dbf771dbd88946 to your computer and use it in GitHub Desktop.
help me
``` r
library(pdftools)
library(tidyverse)
publi_pdf <- pdf_text("https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6060449/pdf/12917_2018_Article_1517.pdf")
publi_lines <- publi_pdf %>%
map(1:length(publi_pdf), readr::read_lines())
publi_lines
#> [[1]]
#> NULL
#>
#> [[2]]
#> NULL
#>
#> [[3]]
#> NULL
#>
#> [[4]]
#> NULL
#>
#> [[5]]
#> NULL
#>
#> [[6]]
#> NULL
#>
#> [[7]]
#> NULL
#>
#> [[8]]
#> NULL
#>
#> [[9]]
#> NULL
#>
#> [[10]]
#> NULL
#>
#> [[11]]
#> NULL
#>
#> [[12]]
#> NULL
```
<sup>Created on 2018-11-21 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)</sup>
@romainfrancois
Copy link

You need map(publi_pdf, readr::read_lines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment