get_dest: Get the destination of a link

Description Usage Arguments Value Examples

Description

For Wikilink and ExternalLink nodes, get_dest will retrieve the destination they are pointing to.

Usage

1
get_dest(nodes, as_text = FALSE)

Arguments

nodes

a set of Wikitext nodes retrieved with get_nodes

as_text

whether to return the results as nodes or strings.

Value

Either a list of nodes or a vector of strings, depending on as_text's value.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(magrittr)
library(mwparser)
raw_wikitext <- "[http://this.is.a external link]"

text <- read_wikitext(raw_wikitext) %>%
   get_nodes(types = "external_links") %>%
   get_dest

## End(Not run)

ropenscilabs/mwparser documentation built on May 29, 2019, 1:20 p.m.