whe_paragraphs: Get number of paragraphs

Description Usage Arguments Value Examples

Description

Counts number of paragraphs in text.

Usage

1
2
3
4
5
6
7
whe_paragraphs(wh)

## S3 method for class 'data.frame'
whe_paragraphs(wh)

## S3 method for class 'character'
whe_paragraphs(wh)

Arguments

wh

highlighted object returned by wh_collect, see examples.

Value

if data.frame is passed will append a column named nparagraphs. If character vector is passed the function returns a character vector.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
library(webhose)
token <- wh_token("xXX-x0X0xX0X-00X")

token %>%
  wh_news(q = '"R programming" OR Python') %>%  # use highlight!
  wh_collect() -> rstats # collect results

rstats %>%
  whe_paragraphs() -> nparagraphs

library(dplyr)

rstats %>%
  mutate(nparagraphs = whe_paragraphs(text)) -> paragraphs

## End(Not run)

JohnCoene/webhoserx documentation built on June 15, 2019, 3:48 p.m.