[R] (no subject)

Matthew Neilson matt at gneilson.plus.com
Fri Apr 27 16:17:44 CEST 2007


Hey,

The syntax is:

if(condition){
      #COMMANDS_A
} else{
      #COMMANDS_B
}

Hope this helps,


-Matt




On Fri Apr 27 15:07 , elyakhlifi mustapha <elyakhlifi_mustapha at yahoo.fr> sent:

>hi,
>I don't understand my error when I submit this program 
>
>> for(k in LR) {
>+                         donRep[[k]] 
>+                         M[[193]] 
>+                         for(k in LR) {
>+                                                if(length(as.numeric(as.character(donRep[[k]][,1]))) == min(C)) {
>+ M[[193]][,k] 
>+ }
>+          else  M[[193]][,k] 
>+                                                }
>+                         }
>> if (subset(donParCara, Id_Cara == 308 , select = Ana_C) == "AV") {
>+                                                                                                                   print(cor(M[[308]], method = "pearson"))
>+                                                                                                                  }
>> else print(cor(M[[193]], method = "spearman"))
>Erreur : erreur de syntaxe dans "else"
>
>Can you help me please?
>
>
>      
>___________________________________________________________________________
>
>
>
>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list