knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The goal of parens is to offer a utility function paren() to build a list of values for SQL IN operator.
paren() will add single quote to each element when the data type is not numeric.
# install.packages('devtools')
devtools::install_github("taekyunk/paren")
This is a basic example of using paren() with SQL IN operator.
id_char <- as.character(1:5) id_num <- 3:8 # paren() will add single quotes if the field is not numeric paren(id_char) paren(id_num) # to match character with numeric paren(as.numeric(id_char)) # to match numeric with character paren(as.character(id_num)) # typical use case will be something like this query <- paste("select * from tablename where id in", paren(id_num), ";") print(query)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.