ft_collect: Collect article text from local files

Description Usage Arguments Details Value Examples

View source: R/collect.R

Description

ft_collect grabs full text data from file paths in your ft_data object (result of call to ft_get()). ft_text is a convenience function to grab the nested text data and bring it up in the list for easier access

Usage

1
2
3
4
5
6
7
8
9
ft_collect(x, ...)

ft_text(x, ...)

## Default S3 method:
ft_text(x, ...)

## S3 method for class 'ft_data'
ft_text(x, ...)

Arguments

x

Input. An object of class ft_data

...

Further args, ignored.

Details

The result of this call is actual text you can read

Value

an object of class ft_data, but the data slot should have character string of text from the XML/plain text/PDF file

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
# Get some data
x <- ft_get('10.1371/journal.pone.0086169')

# note that the data is not in the object, gives NULL
x$plos$data$data

# Collect data from the .xml file
y <- x %>% ft_collect()

# note how the data is now in the object
y$plos$data$data

# Let's get the actual 
## ft_collect() alone, replaces file pointers with parsed text, 
##  maintaining object structure
x %>% ft_collect() 
## pulls the text out of the object
x %>% ft_collect() %>% ft_text()

## End(Not run)

fulltext documentation built on June 12, 2021, 9:06 a.m.