Skip to content

Commit

Permalink
Fix logical error in subset statement
Browse files Browse the repository at this point in the history
  • Loading branch information
cjendres1 committed Nov 3, 2023
1 parent ba00194 commit 38fa70e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/nhanes_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ nhanesSearchTableNames <- function(pattern=NULL, ystart=NULL, ystop=NULL, includ
}
df <- data.frame(hurl |> html_elements(xpath=xpath) |> html_table())

df <- subset(df, grep(paste(pattern,collapse="|"), Doc.File))
df <- subset(df, Doc.File %in% grep(paste(pattern,collapse="|"), Doc.File, value=TRUE))
if(nrow(df)==0) {return(NULL)}
if(!includerdc) {
df <- subset(df, !(Data.File == 'RDC Only'))
Expand Down

0 comments on commit 38fa70e

Please sign in to comment.