Skip to content

Commit

Permalink
Added convenience function for filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Piechotta committed Jan 27, 2020
1 parent 88269cc commit caaae84
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: JACUSA2helper
Type: Package
Title: Post-processing for JACUSA2 output
Version: 1.98
Version: 1.98-1
Depends: R (>= 2.10)
Date: 2019-11-10
Author: Michael Piechotta
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export(copy_attr)
export(cov_col)
export(coverage)
export(extract_ref)
export(filter_all_artefacts)
export(filter_artefact)
export(filter_by)
export(filter_by_max_score)
Expand Down
16 changes: 16 additions & 0 deletions R/helper-filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,19 @@ filter_artefact <- function(filter, artefacts) {

grepl(paste0(artefacts, collapse = "|"), filter)
}

#' Filters all sites with an artefact
#'
#' Removes sites that sites that have been marked by any feature/artefact filter.
#' @param filter vector of strings that contains artefact filter information.
#' @return vector of logical.
#' @examples
#' data(rdd)
#' # remove sites that are marked by artefact filter "D"
#' grouped <- group_by_site(rdd)
#' filtered <- filter_by(grouped, filter_all_artefacts(filter))
#' str(filtered)
#' @export
filter_all_artefacts <- function(filter) {
filter_artefact(filter, c(paste0('\\', EMPTY)))
}
24 changes: 24 additions & 0 deletions man/filter_all_artefacts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit caaae84

Please sign in to comment.