param_get: get the values of a URL's parameters

Description Usage Arguments Value See Also Examples

View source: R/RcppExports.R

Description

URLs can have parameters, taking the form of name=value, chained together with & symbols. param_get, when provided with a vector of URLs and a vector of parameter names, will generate a data.frame consisting of the values of each parameter for each URL.

Usage

1
param_get(urls, parameter_names = NULL)

Arguments

urls

a vector of URLs

parameter_names

a vector of parameter names. If NULL (default), will extract all parameters that are present.

Value

a data.frame containing one column for each provided parameter name. Values that cannot be found within a particular URL are represented by an NA.

See Also

url_parse for decomposing URLs into their constituent parts and param_set for inserting or modifying key/value pairs within a query string.

Examples

1
2
3
#A very simple example
url <- "https://google.com:80/foo.php?this_parameter=selfreferencing&hiphop=awesome"
parameter_values <- param_get(url, c("this_parameter","hiphop"))

urltools documentation built on May 1, 2019, 6:49 p.m.