Skip to content

Commit

Permalink
Improve readability, use variable "keep_row"
Browse files Browse the repository at this point in the history
  • Loading branch information
hsonne committed Apr 4, 2024
1 parent 08bc0ea commit 562d1b2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions R/filter_scripts.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
#' @importFrom kwb.utils matchesCriteria removeEmptyColumns
filter_scripts <- function(scriptInfo, fun.min = 5, epf.min = 10)
{
criteria <- c(paste("fun >=", fun.min), paste("epf >=", epf.min))

scriptInfo <- scriptInfo[kwb.utils::matchesCriteria(scriptInfo, criteria), ]

kwb.utils::removeEmptyColumns(scriptInfo)
keep_row <- kwb.utils::matchesCriteria(
Data = scriptInfo,
criteria = c(
paste("fun >=", fun.min),
paste("epf >=", epf.min)
)
)

kwb.utils::removeEmptyColumns(scriptInfo[keep_row, ])
}

0 comments on commit 562d1b2

Please sign in to comment.