Description Usage Arguments Value See Also Examples
View source: R/query-helpers.R
This is a utility function used in insert_query_param
. Given a
single query parameter-value pair, or ordered character vectors, it will
properly format and return a query string.
1 | format_query_param(param, value)
|
param |
The parameter name. Can be a character string, e.g. "userID", or a character vector, such as c("userID", "favorite_food"). |
value |
The parameter value. Can be a character string, "jdtrat", or a character vector, such as c("jdtrat", "sushi"). |
A formatted query string
Other Query Strings:
extract_query_param()
,
insert_query_param()
1 2 3 4 5 6 7 8 9 | # Returns proper formatting for single query parameters: "?person=jdtrat"
format_query_param(param = "person",
value = "jdtrat")
# Returns proper formatting for multiple query parameters:
# "?person=jdtrat&favorite_food=sushi&best_cat=tucker"
format_query_param(param = c("person", "favorite_food", "best_cat"),
value = c("jdtrat", "sushi", "tucker")
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.