Skip to content

Commit

Permalink
Style code (GHA)
Browse files Browse the repository at this point in the history
  • Loading branch information
elena-krismer committed Oct 10, 2024
1 parent 3feb11f commit 4f2a737
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions R/impute.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,25 @@ impute <- function(data,
...) {
noise_missing <- missing(noise) # check if argument noise was provided or not

if (method == "randomforest"){
if (method == "randomforest") {
data_wide <- data %>%
tidyr::pivot_wider(
id_cols=sample,
names_from =grouping,
values_from = intensity_log2) %>%
id_cols = sample,
names_from = grouping,
values_from = intensity_log2
) %>%
dplyr::select(sample)

data_wide <- data.frame(lapply(data_wide, function(x) as.numeric(as.character(x))))
data_imputed_rf <- missForest(data_wide, ...)

data_imputed <-data_imputed_rf$ximp
data_imputed <- data_imputed_rf$ximp
data_imputed[sample] <- data %>%
tidyr::pivot_wider(
id_cols = sample,
names_from = grouping,
values_from = intensity_log2) %>%
values_from = intensity_log2
) %>%
dplyr::pull(sample)

data_imputed <- data_imputed %>%
Expand Down

0 comments on commit 4f2a737

Please sign in to comment.