samedi 24 janvier 2015

R IF ELSE statement [duplicate]


This question already has an answer here:




Maybe it's not the late hour but something in the following IF ELSE statement give me an error:



if (exists("lm_summary"))
{
col <- list(mnm_coef,cm,auc,lm_summary$coefficients,lm_summary$training_testing_error_ratio)
}

else {
col <- list(mnm_coef,cm,auc,NULL,NULL)
}


output:



> if (exists("lm_summary"))
+ {
+ col <- list(mnm_coef,cm,auc,lm_summary$coefficients,lm_summary$training_testing_error_ratio)
+ }
>
> else {
Error: unexpected 'else' in " else"
> col <- list(mnm_coef,cm,auc,NULL,NULL)
> }
Error: unexpected '}' in " }"
>


idea?


Aucun commentaire:

Enregistrer un commentaire