Skip to content

Commit

Permalink
commenting out examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Tirgit committed Nov 30, 2020
1 parent da2aa40 commit d5a092b
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 131 deletions.
1 change: 1 addition & 0 deletions .Rproj.user/shared/notebooks/paths
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/Users/med-tv_/Documents/GitHub/missCompare/R/MCAR.R="6913D720"
/Users/med-tv_/Documents/GitHub/missCompare/R/MNAR.R="9877AF3D"
/Users/med-tv_/Documents/GitHub/missCompare/R/all_patterns.R="F8724802"
/Users/med-tv_/Documents/GitHub/missCompare/R/check.Renviron="2DC40FEC"
/Users/med-tv_/Documents/GitHub/missCompare/R/clean.R="F8B1BB77"
/Users/med-tv_/Documents/GitHub/missCompare/R/clindata_miss.R="E1AC835C"
/Users/med-tv_/Documents/GitHub/missCompare/R/get_data.R="4BA118BE"
Expand Down
1 change: 0 additions & 1 deletion R/check.Renviron

This file was deleted.

24 changes: 11 additions & 13 deletions R/impute_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,17 @@
#' @name impute_data
#'
#' @examples
#' \donttest{
#' #running 10 iterations of all algorithms (that allow for multiple imputation) and
#' #one copy of those that do not allow for multiple imputations
#' impute_data(df, scale = TRUE, n.iter = 10,
#' sel_method = c(1:16))
#' #running 20 iterations of missForest (e.g. this was the best performing algorithm
#' #in simulations) on a non-scaled dataframe
#' impute_data(df, scale = FALSE, n.iter = 20,
#' sel_method = c(14))
#' #running 1 iterations of four selected non-probabilistic algorithms on a scaled dataframe
#' impute_data(df, scale = TRUE, n.iter = 1,
#' sel_method = c(2:3, 5, 7))
#' }
#' ## running 10 iterations of all algorithms (that allow for multiple imputation) and
#' ## one copy of those that do not allow for multiple imputations
#' # impute_data(df, scale = TRUE, n.iter = 10,
#' # sel_method = c(1:16))
#' ## running 20 iterations of missForest (e.g. this was the best performing algorithm
#' ## in simulations) on a non-scaled dataframe
#' # impute_data(df, scale = FALSE, n.iter = 20,
#' # sel_method = c(14))
#' ## running 1 iterations of four selected non-probabilistic algorithms on a scaled dataframe
#' # impute_data(df, scale = TRUE, n.iter = 1,
#' # sel_method = c(2:3, 5, 7))
#'
#' @export

Expand Down
40 changes: 19 additions & 21 deletions R/impute_simulated.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,26 @@
#' \item{Plot_KS}{Faceted boxplot of KS values per missingness pattern and missing data imputation algorithm}
#'
#' @examples
#' \donttest{
#' #in case there is no assumed missingness pattern per variable
#' wrap <- impute_simulated(rownum = metadata$Rows,
#' colnum = metadata$Columns,
#' cormat = metadata$Corr_matrix,
#' MD_pattern = metadata$MD_Pattern,
#' NA_fraction = metadata$Fraction_missingness,
#' min_PDM = 10,
#' n.iter = 50)
#' ## in case there is no assumed missingness pattern per variable
#' # wrap <- impute_simulated(rownum = metadata$Rows,
#' # colnum = metadata$Columns,
#' # cormat = metadata$Corr_matrix,
#' # MD_pattern = metadata$MD_Pattern,
#' # NA_fraction = metadata$Fraction_missingness,
#' # min_PDM = 10,
#' # n.iter = 50)
#'
#' #in case there is a pre-defined assumed pattern
#' wrap <- impute_simulated(rownum = metadata$Rows,
#' colnum = metadata$Columns,
#' cormat = metadata$Corr_matrix,
#' MD_pattern = metadata$MD_Pattern,
#' NA_fraction = metadata$Fraction_missingness,
#' min_PDM = 10,
#' assumed_pattern = c('MAR','MAR','MCAR','MCAR',
#' 'MNAR','MCAR','MAR','MNAR',
#' 'MCAR','MNAR','MCAR'),
#' n.iter = 50)
#' }
#' ## in case there is a pre-defined assumed pattern
#' # wrap <- impute_simulated(rownum = metadata$Rows,
#' # colnum = metadata$Columns,
#' # cormat = metadata$Corr_matrix,
#' # MD_pattern = metadata$MD_Pattern,
#' # NA_fraction = metadata$Fraction_missingness,
#' # min_PDM = 10,
#' # assumed_pattern = c('MAR','MAR','MCAR','MCAR',
#' # 'MNAR','MCAR','MAR','MNAR',
#' # 'MCAR','MNAR','MCAR'),
#' # n.iter = 50)
#'
#' @export

Expand Down
10 changes: 4 additions & 6 deletions R/post_imp_diag.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@
#' \item{Correlation_plot}{Scatter plot of mean pairwise Pearson's correlation coefficients from the original dataframe (with missingness) and the imputed dataframe. The blue line represents a line with slope 1 and intercept 0. The red line is a fitted line of the correlation coefficient pairs. The error bars around the points represent the individual 95\% confidence intervals drawn from bootstrapping the correlation coefficients}
#'
#' @examples
#' \donttest{
#' diagnostics <- post_imp_diag(X_orig = df_miss, X_imp = df_imputed, scale=TRUE)
#' diagnostics$Histograms$variable_X
#' diagnostics$Boxplots$variable_Z
#' diagnostics$Statistics$variable_Y
#' }
#' # diagnostics <- post_imp_diag(X_orig = df_miss, X_imp = df_imputed, scale=TRUE)
#' # diagnostics$Histograms$variable_X
#' # diagnostics$Boxplots$variable_Z
#' # diagnostics$Statistics$variable_Y
#'
#' @export

Expand Down
22 changes: 10 additions & 12 deletions R/test_mi.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@
#' @inherit test_AmeliaII return
#'
#' @examples
#' \donttest{
#' clindata_miss_mini <- clindata_miss[1:80,1:4]
#' cleaned <- clean(clindata_miss_mini, missingness_coding = -9)
#' metadata <- get_data(cleaned)
#' simulated <- simulate(rownum = metadata$Rows, colnum = metadata$Columns,
#' cormat = metadata$Corr_matrix)
#' miss_list <- all_patterns(simulated$Simulated_matrix,
#' MD_pattern = metadata$MD_Pattern,
#' NA_fraction = metadata$Fraction_missingness,
#' min_PDM = 2)
#' # clindata_miss_mini <- clindata_miss[1:80,1:4]
#' # cleaned <- clean(clindata_miss_mini, missingness_coding = -9)
#' # metadata <- get_data(cleaned)
#' # simulated <- simulate(rownum = metadata$Rows, colnum = metadata$Columns,
#' # cormat = metadata$Corr_matrix)
#' # miss_list <- all_patterns(simulated$Simulated_matrix,
#' # MD_pattern = metadata$MD_Pattern,
#' # NA_fraction = metadata$Fraction_missingness,
#' # min_PDM = 2)
#'
#' test_mi(X_hat = simulated$Simulated_matrix, list = miss_list)
#' }
#' # test_mi(X_hat = simulated$Simulated_matrix, list = miss_list)
#'
#' @export

Expand Down
22 changes: 10 additions & 12 deletions R/test_pcaMethods_NLPCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@
#' @inherit test_AmeliaII return
#'
#' @examples
#' \donttest{
#' clindata_miss_mini <- clindata_miss[1:80,1:4]
#' cleaned <- clean(clindata_miss_mini, missingness_coding = -9)
#' metadata <- get_data(cleaned)
#' simulated <- simulate(rownum = metadata$Rows, colnum = metadata$Columns,
#' cormat = metadata$Corr_matrix)
#' miss_list <- all_patterns(simulated$Simulated_matrix,
#' MD_pattern = metadata$MD_Pattern,
#' NA_fraction = metadata$Fraction_missingness,
#' min_PDM = 2)
#' # clindata_miss_mini <- clindata_miss[1:80,1:4]
#' # cleaned <- clean(clindata_miss_mini, missingness_coding = -9)
#' # metadata <- get_data(cleaned)
#' # simulated <- simulate(rownum = metadata$Rows, colnum = metadata$Columns,
#' # cormat = metadata$Corr_matrix)
#' # miss_list <- all_patterns(simulated$Simulated_matrix,
#' # MD_pattern = metadata$MD_Pattern,
#' # NA_fraction = metadata$Fraction_missingness,
#' # min_PDM = 2)
#'
#' test_pcaMethods_NLPCA(X_hat = simulated$Simulated_matrix, list = miss_list)
#' }
#' # test_pcaMethods_NLPCA(X_hat = simulated$Simulated_matrix, list = miss_list)
#'
#' @export

Expand Down
5 changes: 3 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ This is a resubmission. In this version I have made the following changes in res

* Please write TRUE and FALSE instead of T and F. (Please don't use 'T' or 'F' as vector names.): FIXED. All instances in all functions checked, Ts and Fs replaced with TRUEs and FALSEs.

* \dontrun{} should only be used if the example really cannot be executed (e.g. because of missing additional software, missing API keys, ...) by the user [...] Please unwrap the examples if they are executable in < 5 sec, or replace
\dontrun{} with \donttest{}: FIXED. Examples are now marked with donttest{} in the following functions: impute_data(), impute_simulated(), post_imp_diag(), test_mi() and test_pcaMethods_NLPCA() due to longer executable times.
* \dontrun{} should only be used if the example really cannot be executed (e.g. because of missing additional software, missing API keys, ...) by the user [...] Please unwrap the examples if they are executable in < 5 sec, or replace \dontrun{} with \donttest{}: FIXED, although with a hack. I really tried using donttest as
you suggested, but it just didn't work - read all material on this in forums and still couldn't get it to
work, so those examples that take too much time are now commented out in the following five functions: impute_data(), impute_simulated(), post_imp_diag(), test_mi() and test_pcaMethods_NLPCA().

* Have the issues why your package was archived been fixed?: FIXED. The package was archived because there were ERRORs that needed fixing related to the data.table::melt() function, that has been passed to various categories of objects, e.g. matrices and data.frames - as data.table::melt() currently only has a method for data.tables, objects have either been converted to data.tables or another solutions were found to replace existing code.
24 changes: 11 additions & 13 deletions man/impute_data.Rd

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

40 changes: 19 additions & 21 deletions man/impute_simulated.Rd

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

10 changes: 4 additions & 6 deletions man/post_imp_diag.Rd

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

22 changes: 10 additions & 12 deletions man/test_mi.Rd

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

22 changes: 10 additions & 12 deletions man/test_pcaMethods_NLPCA.Rd

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

0 comments on commit d5a092b

Please sign in to comment.