Skip to content

Commit

Permalink
remove requirement for stapmr package
Browse files Browse the repository at this point in the history
  • Loading branch information
dosgillespie committed Dec 16, 2022
1 parent 53d29c1 commit dbdd9e9
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 10 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ Imports:
crayon,
TTR,
Rfast,
stats
stats,
brew
RdMacros: Rdpack, lifecycle
VignetteBuilder: knitr
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Depends:
R (>= 2.10)
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export("%fin%")
export(AlcBinge)
export(AlcBinge_stapm)
export(AlcLags)
Expand Down Expand Up @@ -27,5 +28,4 @@ importFrom(data.table,rbindlist)
importFrom(data.table,setDT)
importFrom(data.table,setnames)
importFrom(lifecycle,deprecate_soft)
importFrom(stapmr,"%fin%")
importFrom(stats,ar)
1 change: 0 additions & 1 deletion R/AlcLags.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#' on an individual's relative risk of disease has so far emerged.
#'
#' @importFrom data.table := setDT setnames data.table
#' @importFrom stapmr %fin%
#'
#' @references
#' \insertRef{holmes2012temporal}{tobalcepi}
Expand Down
1 change: 0 additions & 1 deletion R/RRAlc.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#' @return Returns a numeric vector of each individual's relative risks for the alcohol related disease specified by "disease".
#'
#' @importFrom data.table := setDT setnames fifelse
#' @importFrom stapmr %fin%
#'
#' @export
#'
Expand Down
1 change: 0 additions & 1 deletion R/RRFunc.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
#'
#'
#' @importFrom data.table := setDT setnames copy rbindlist
#' @importFrom stapmr %fin%
#'
#' @export
#'
Expand Down
1 change: 0 additions & 1 deletion R/RRtob.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#' specified by "disease".
#'
#' @importFrom data.table := setDT setnames copy
#' @importFrom stapmr %fin%
#'
#' @export
#'
Expand Down
1 change: 0 additions & 1 deletion R/TobAlcInt.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#' specified by "disease".
#'
#' @importFrom data.table := setDT setnames copy
#' @importFrom stapmr %fin%
#'
#' @export
#' @references
Expand Down
1 change: 0 additions & 1 deletion R/TobLags.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#' on an individual's relative risk of disease has so far emerged.
#'
#' @importFrom data.table := setDT setnames data.table
#' @importFrom stapmr %fin%
#'
#' @export
#'
Expand Down
30 changes: 30 additions & 0 deletions R/fast_match.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

#' Fast matching
#'
#' A faster version of `%in%`.
#'
#' See [fastmatch::fmatch()]
#'
#' @param x values to be matched
#' @param table values to be matched against
#'
#' @return Logical indicating match or not
#' @export
#'
#' @keywords internal
#'
#' @examples
#'
#' \dontrun{
#'
#' x %fin% y
#'
#' }
#'
#'
#'
`%fin%` <- function(x, table) {

fastmatch::fmatch(x, table, nomatch = 0L) > 0L

}
1 change: 0 additions & 1 deletion R/subgroupRisk.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#' @return Returns a data table containing the subgroup specific summaries for each disease.
#'
#' @importFrom data.table := setDT setnames copy .SD .N
#' @importFrom stapmr %fin%
#'
#' @export
#'
Expand Down
34 changes: 34 additions & 0 deletions man/grapes-fin-grapes.Rd

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

0 comments on commit dbdd9e9

Please sign in to comment.