Skip to content

Commit

Permalink
Fix check warnings and errors. vbump
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbecker committed Aug 4, 2021
1 parent 9c2eb9c commit e0c0f31
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ Description: This package provides a general framework and utility functions for
of other already existing or recipe-specified variables. It also supports
the simulation or augmentation of data which encodes a 1-to-many relationship
with a foreign-key in an existing table.
Version: 0.0.3
Version: 0.0.4
License: Artistic-2.0
Encoding: UTF-8
RoxygenNote: 7.1.1
Copyright: F. Hoffmann-La Roche Ltd
Depends: tibble
Imports: stats,
methods
methods,
tibble
Suggests: knitr,
dplyr,
ggplot2,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ import(methods)
importFrom(methods,is)
importFrom(stats,runif)
importFrom(stats,setNames)
importFrom(tibble,tribble)
1 change: 1 addition & 0 deletions R/create_data.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#' @importFrom stats runif setNames
#' @importFrom methods is
#' @importFrom tibble tribble
NULL

#' Sentinel Values for Recipes
Expand Down
9 changes: 5 additions & 4 deletions R/scaffold_join_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#' @param keyvar character(1). The name of the column to treat as a foreign key.
#' @param count numeric(1). The number of times each foreign-key value should appear in the
#' scaffold data.
#' @param tblnm character(1). The name of the table in the database in which to find the keyvar
#' @param prop_present numeric(1). Proportion of the key values in the
#' foreign table to include rows for in the
#' dimension-scaffold. Defaults to 1 (all values present).
Expand Down Expand Up @@ -53,11 +54,11 @@ rep_per_key <- function(keyvar, tblnm, count, prop_present = 1) {
#' @rdname reljoin_funcs
#' @examples
#' foreign_tbl <- data.frame(id = 1:5)
#' perkey_fun <- rep_per_key("id", 2, .6)
#' perkey_fun(.dbtab = foreign_tbl)
#' perkey_fun <- rep_per_key("id", tblnm = "foreign_tbl", 2, .6)
#' perkey_fun(.db = list(foreign_tbl = foreign_tbl))
#'
#' randrep_fun <- rand_per_key("id", mincount = 1, maxcount = 5)
#' randrep_fun(.dbtab = foreign_tbl)
#' randrep_fun <- rand_per_key("id", tblnm = "foreign_tbl", mincount = 1, maxcount = 5)
#' randrep_fun(.db = list(foreign_tbl = foreign_tbl))
#' @export
rand_per_key <- function(keyvar, tblnm, mincount = 1, maxcount = 20, prop_present = .5) {
function(n, .db, .df) {
Expand Down
2 changes: 1 addition & 1 deletion R/table_recipe_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ rand_posixct <- function( start, end,
#'
#' @param n numeric(1). The length (number of rows) to use when initializing.
#' @param colnames character. Vector of column names to use. Can be omitted if \code{colclasses} is specified.
#' @param colclass named character. Optional. Names must be identical to \code{colnames} if specified, values are classes such that \code{as(NA, .)} will succeed. Defaults to \code{NA} for each column, indicating character columns.
#' @param colclasses named character. Optional. Names must be identical to \code{colnames} if specified, values are classes such that \code{as(NA, .)} will succeed. Defaults to \code{NA} for each column, indicating character columns.
#'
#' @return A data.frame with the new columns and \code{n} rows.
#' @export
Expand Down
2 changes: 1 addition & 1 deletion man/init_new_cols.Rd

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

14 changes: 8 additions & 6 deletions man/reljoin_funcs.Rd

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

0 comments on commit e0c0f31

Please sign in to comment.