b_xpath: Bastiat, extract from an XPATH but keep missing nodes as...

View source: R/b_xpath.R

b_xpathR Documentation

Bastiat, extract from an XPATH but keep missing nodes as NA's.

Description

Performs some cleaning operation on a string. It's a wrapper that helps standardise code somewhat.

Usage

b_xpath(
  html.doc = "html",
  path.base = NULL,
  path.extension = NULL,
  get.attribute = F,
  the.attribute = "href"
)

Arguments

path.base

Enter a portion of the path that you are sure that exists.

path.extension

Enter the remainder where there may be gaps wrt to final node you are interested in.

get.attribute

Do you want to extract the value from an attribute? Default is 'FALSE'.

the.attribute

Name the attribute you want to extract the value from. Default is 'href'.

Value

A vector of values.

Author(s)

Johannes Fritz for GTA based on 'hrbrmstr' in https://stackoverflow.com/questions/32429574

References

www.globaltradealert.org


global-trade-alert/gtabastiat documentation built on June 4, 2023, 6:40 a.m.