From e2324ef728ab2cdf2f686a5e5ed6c8f579780d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pepe=20M=C3=A1rquez=20Romero?= Date: Thu, 2 Mar 2023 16:46:36 +0100 Subject: [PATCH] =?UTF-8?q?peque=C3=B1a=20mejora=20al=20tratamiento=20de?= =?UTF-8?q?=20variables=20que=20no=20tienen=20tipo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- valid_variables_script2.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/valid_variables_script2.R b/valid_variables_script2.R index 22771bc..1b2221d 100644 --- a/valid_variables_script2.R +++ b/valid_variables_script2.R @@ -137,8 +137,12 @@ check_values_format <- function(valid_columns, codebook_param){ current_column <- valid_columns[[1]][[i]] print(current_column) variable_type <- codebook_param$Variable.type[codebook$Harmonised.variable.name == current_column] + + if (is.na(variable_type)){ + next + } - if(!is.na(variable_type) && variable_type == "Continuous"){ + if(variable_type == "Continuous"){ ################## ESTO PODRÍA IR EN UNA FUNC DIFERENTE ############# @@ -185,7 +189,7 @@ check_values_format <- function(valid_columns, codebook_param){ ) ################## FIN ESTO PODRÍA IR EN UNA FUNC DIFERENTE ############# - }else if (!is.na(variable_type) && (variable_type == "Categorical" || variable_type == "Binary")){ + }else if (variable_type == "Categorical" || variable_type == "Binary"){ contingency_table <- ds.table(paste("data$",current_column)) counts <- contingency_table[[1]][[3]] } -- 2.24.1