From 4f2a737cad372149411267c4198d99cea30d0239 Mon Sep 17 00:00:00 2001 From: elena-krismer Date: Thu, 10 Oct 2024 08:09:31 +0000 Subject: [PATCH] Style code (GHA) --- R/impute.R | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/R/impute.R b/R/impute.R index 3ecf60bf..c3bddbdd 100644 --- a/R/impute.R +++ b/R/impute.R @@ -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 %>%