22# .ChemQ: Create tcplLoadChem query string
33# -------------------------------------------------------------------------------
44
5+ # ' @title Function to support queries by chemical
6+ # ' @note This function is not exported and not intended to be used by the user.
7+ # '
8+ # ' @param field Character, the field to query on
9+ # ' @param val Vector of values to subset on
10+ # ' @param exact Logical, should chemical names be considered exact?
11+ # '
12+ # ' @description
13+ # ' \code{.ChemQ} creates tcplLoadChem query string
14+ # '
15+ # ' @seealso \code{\link{tcplLoadData}}
16+ # ' @seealso \code{\link{tcplLoadChem}}
517.ChemQ <- function (field , val , exact ) {
618
719 qformat <-
2941 if (exact ) {
3042 qformat <- paste(qformat , " chnm IN (%s);" )
3143 val <- paste0(" \" " , val , " \" " , collapse = " ," )
32- qstring <- sprintf(qformat , val , val )
44+ qstring <- sprintf(qformat , val )
3345 } else {
3446 qformat <- paste(qformat , " chnm RLIKE %s;" )
3547 val <- paste0(" \" " , paste(val , collapse = " |" ), " \" " )
36- qstring <- sprintf(qformat , val , val )
48+ qstring <- sprintf(qformat , val )
3749 }
3850 } else if (nfld == ' chem.only' ) {
3951 qstring <- "
6476# .ChemListQ: Create tcplLoadChemList query string
6577# -------------------------------------------------------------------------------
6678
79+ # ' @title Function to support queries by chemical
80+ # ' @note This function is not exported and not intended to be used by the user.
81+ # '
82+ # ' @param field Character, the field to query on
83+ # ' @param val Vector of values to subset on
84+ # '
85+ # ' @description
86+ # ' \code{.ChemListQ} creates tcplLoadChemList query string
87+ # '
88+ # ' @seealso \code{\link{tcplLoadChemList}}
6789.ChemListQ <- function (field , val ) {
6890
6991 qformat <- " SELECT * FROM chemical_lists"
90112
91113# -------------------------------------------------------------------------------
92114# END .ChemListQ
93- # -------------------------------------------------------------------------------
94-
115+ # -------------------------------------------------------------------------------
0 commit comments