whe_search_1p: Search in the first paragraph

Description Usage Arguments Value See Also Examples

Description

Search the number of times a regex is present in the first parargraph.

Usage

1
2
3
4
whe_search_1p(wh, search, output)

## S3 method for class 'data.frame'
whe_search_1p(wh, search, output)

Arguments

wh

highlighted object returned by wh_collect, see examples.

search

regex to search, passed to grepl.

output

name of output column.

Value

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

See Also

whe_mentioned

Examples

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

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

rstats %>%
  whe_search_1p("Hadley", "hadley")

## End(Not run)

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