Dear Nuel,

could you send the error messages in English please. Adds & between the two conditions and try again

if ( (data[pa,k]== df[,j]) && (data[ch,k]==i))

Best
M



anderson nuel a écrit :
Dear r-help,

Could you help me to find a solution for this error:

Il y a eu 50 avis ou plus (utilisez warnings() pour voir les 50 premiers)

warnings()
Messages d'avis :
1: In if ((data[pa, k] == df[, j]) & (data[ch, k] == i)) { ... :
  la condition a une longueur > 1 et seul le premier élément est utilisé
2: In if ((data[pa, k] == df[, j]) & (data[ch, k] == i)) { ... :
  la condition a une longueur > 1 et seul le premier élément est utilisé


ch=3
pa=c(1,2)
r=2
t=4
nb=15
ni=array(0,c( r,t))

for ( i  in 1:r){

for (j in 1:t ){

    for (k in 1:nb){

        if ( (data[pa,k]== df[,j]) & (data[ch,k]==i)){

            ni[i,j]=ni[i,j]+1
        }
    }
}
}

Best  Regards

        [[alternative HTML version deleted]]

------------------------------------------------------------------------

______________________________________________
R-help@r-project.org 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.


--


Mohamed Lajnef,IE INSERM U955 eq 15
Pôle de Psychiatrie
Hôpital CHENEVIER
40, rue Mesly
94010 CRETEIL Cedex FRANCE
mohamed.laj...@inserm.fr
tel : 01 49 81 31 31 (poste 18470)
Sec : 01 49 81 32 90
fax : 01 49 81 30 99
______________________________________________
R-help@r-project.org 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.

Reply via email to