Skip to content

Commit

Permalink
fix error in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
wolski committed May 14, 2024
1 parent d1f365b commit 1fc552e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion R/tidyMS_R6_Modelling.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @export
#' @keywords internal
#' @examples
#' mod <- build_models(model = " ~ Treatment * Background", weight_missing = 1)
#' mod <- build_models(model = "interaction", weight_missing = 1)
#' stopifnot(dim(mod$modelDF) == c(10,9))
#'
build_models <- function(model = c("factors", "interaction"), Nprot = 10, with_missing = TRUE, weight_missing = 1) {
Expand Down
14 changes: 7 additions & 7 deletions R/tidyMS_missigness_V2.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
#' Contrasts <- c("group.b-a" = "group_A - group_B", "group.a-ctrl" = "group_A - group_Ctrl")
#' dd <- prolfqua::sim_lfq_data_protein_config(Nprot = 100,weight_missing = 2)
#' mh <- prolfqua::MissingHelpers$new(dd$data, dd$config, prob = 0.8,weighted = TRUE)
#' mh$get_stats()
#' mh$get_LOD()
#' mh$impute_weighted_lod()
#' mh$impute_lod()
#' mh$get_poolvar()
#' xx <- mh$get_stats()
#' xx <- mh$get_LOD()
#' xx <- mh$impute_weighted_lod()
#' xx <- mh$impute_lod()
#' xx <- mh$get_poolvar()
#' bb <- mh$get_contrast_estimates(Contrasts)
#' mh$get_contrasts(Contrasts)
#'
Expand Down Expand Up @@ -112,8 +112,8 @@ MissingHelpers <- R6::R6Class(
meandf$sd <- ifelse(meandf$sd > 0, meandf$sd, minsd)
meandf$sdT <- ifelse(meandf$sdT > 0, meandf$sdT, minsd)

pooled <- pooled |> mutate(sd = ifelse(is.na(sd) ,meandf$sd, sd))
pooled <- pooled |> mutate(sdT = ifelse(is.na(sdT) , meandf$sdT, sdT ))
pooled <- pooled |> mutate(sd = ifelse(is.na(sd) | sd == 0 ,meandf$sd, sd))
pooled <- pooled |> mutate(sdT = ifelse(is.na(sdT) | sdT == 0, meandf$sdT, sdT ))
pooled <- pooled |> mutate(df = ifelse(df == 0, 1, df))
return(pooled)
},
Expand Down
10 changes: 5 additions & 5 deletions man/MissingHelpers.Rd

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

2 changes: 1 addition & 1 deletion man/build_models.Rd

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

0 comments on commit 1fc552e

Please sign in to comment.