grab_args_clean: Arg helper with cleaning

Description Usage Details Examples

View source: R/grab_args.R

Description

grab_args_clean

Usage

1

Details

This is a version of grab_args that will drop NULL values, as well as match any arguments which may have multiple options. The main difference here is that this will handle any need for match.arg in parameter inputs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
t.search_test2 <- function(q = NULL, geocode = NULL, lang = NULL, locale = NULL, result_type = c("mixed", "recent", "popular"),
                           count = 100, until = NULL, since_id = NULL, max_id = NULL, include_entities = FALSE){

   query <- grab_args_clean()


   query

}

> t.search_test2()
$result_type
[1] "mixed"
$count
[1] 100
$include_entities
[1] FALSE

CarlBoneri/grabargs documentation built on Oct. 30, 2019, 5:35 a.m.