-
Notifications
You must be signed in to change notification settings - Fork 1
/
.Rhistory
26 lines (26 loc) · 983 Bytes
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
install.packages("pdftools")
install.packages("pdftools")
library(pdftools)
library("glue")
library("tidyverse")
raw_text <- pdf_text("smoking cessation/tablep1.pdf")
getwd()
raw_text <- pdf_text("tablep1.pdf")
table <- str_split(raw_text, "\r", simplify = TRUE) %>% str_split("\n", simplify = TRUE) %>% str_split(" ", simplify = TRUE)
View(table)
table <- table[table[ , 1] != "", ]
table
head(table)
write.csv(table, "table1.csv")
raw_text <- pdf_text("tablep2.pdf")
write.csv(table, "table1.csv")
raw_text <- pdf_text("tablep2.pdf")
table <- str_split(raw_text, "\r", simplify = TRUE) %>% str_split("\n", simplify = TRUE) %>% str_split(" ", simplify = TRUE)
View(table)
table <- table[table[ , 1] != "", ]
head(table)
write.csv(table, "table2.csv")
raw_text <- pdf_text("tablep3.pdf")
table <- str_split(raw_text, "\r", simplify = TRUE) %>% str_split("\n", simplify = TRUE) %>% str_split(" ", simplify = TRUE)
View(table)
write.csv(table, "table3.csv")