Hola, qué tal? Habría que ver qué contiene el objeto phen_tot, pero la expresión phen_tot$convergence[i][j] es muy sospechosa. Qué estructura tiene phen_tot$convergence?
Un saludo, Carlos J. Gil Bellosta El vie., 25 ene. 2019 13:32, Gemma Ruiz-Olalla <gemma.ruizola...@gmail.com> escribió: > Buenas tardes, > > Estamos intentando hacer esta función, y sabemos que el bucle funciona (lo > hemos testeado). Pero nos da este error ya en la primera línea: > > "Error in if (phen_tot$convergence[i][j] == '2' || phen_tot$r_square[i][j] > <= : valor ausente donde TRUE/FALSE es necesario" > > Hemos evitado usar Tidyverse expresamente por la complejidad de la toma de > decisiones del árbol; por eso queremos mantener los bucles "for". > > ¿Alguien nos puede echar una mano para ver qué falla? > > > for(i in l_plates) { > for(j in l_analytes) { > > # arguments > if(phen_tot$convergence[i][j] == '2' || phen_tot$r_square[i][j] <= > 0.9) { > > # first condition > phen_tot$convergence_cor <- 'F' > phen_tot$use <- 'F' > phen_tot$ref_val <- 15000 > > # second condition > }else {phen_tot$convergence_cor[i][j] <- 'T' > if(phen_tot$max_log10mfi[i][j] < log10(15000)){ > phen_tot$use[i][j] <- 'F' > phen_tot$ref_val[i][j] <- 15000 > > # third condition > }else {phen_tot$use[i][j] <- 'T' > phen_tot$ref_val[i][j] <- phen_tot$pred_log10mfi[i][j] > } > } > } > } > > > Muchas gracias, > > -- > Gemma > > [[alternative HTML version deleted]] > > _______________________________________________ > R-help-es mailing list > R-help-es@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-help-es > [[alternative HTML version deleted]] _______________________________________________ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es