textreadr (version 0.3.0)

read_document: Generic Function to Read in a Document

Description

Generic function to read in a .pdf, .txt, .docx, or .doc file.

Usage

read_document(file, combine = FALSE, ...)

Arguments

file
The path to the a .pdf, .txt, .docx, or .doc file.
combine
logical. If TRUE the vector is concatenated into a single string via combine
...
Other arguments passed to read_pdf, read_docx, read_doc, or readLines.

Value

Returns a list of string vectors.

Examples

Run this code
## .pdf
pdf_doc <- system.file("docs/rl10075oralhistoryst002.pdf",
    package = "textreadr")
read_document(pdf_doc)

## .docx
docx_doc <- system.file("docs/Yasmine_Interview_Transcript.docx",
    package = "textreadr")
read_document(docx_doc)

## .txt
txt_doc <- system.file('docs/textreadr_creed.txt', package = "textreadr")
read_document(txt_doc)

## Not run: 
# doc_doc <- system.file("docs/Yasmine_Interview_Transcript.doc",
#     package = "textreadr")
# read_document(doc_doc)
# ## End(Not run)

Run the code above in your browser using DataLab