View source: R/sasWhereConstructors.R
sasSubstr | R Documentation |
Helper function to construct a SAS 'where' statement to search through substrings in a SAS dataset via importSAS
sasSubstr(str.vec, target.var)
str.vec |
Character vector where each element is the start of the substring that should be searched for. Fx. c("DI05", "DI06) will search for any recrods that start with DI05 or DI06. |
target.var |
Character name of the variable in the SAS dataset that is to be searched |
The function allows a user to search for strings matching those in 'str.vec' in SAS datasets. Fx it can be used to find records in the LPR that match an ICD code
Returns a string that can be passed to the "where" arguments of importSAS, or combined with other conditions in sasWhereConstructor
Matthew Phelps <mphelps@hjerteforeningen.dk>
importSAS
library(heaven)
x <- c("DI05", "DI06")
sasSubstr(x, target.var="A")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.