2010-11-21 7 views
0

Dans le code suivant, je me suis la « cible d'affectation à l'objet non élargit la langue » Erreur:« cible d'affectation se développe pour objet non langue » dans R

> rho=c(0,0,0) 
> if (rho[1]>1 || rho[1] <-1 || rho[2]>1 || rho[2] <-1 || rho[3]>1 || rho[3] <-1){ 
+ cat("Correlation must be within [-1,1]!\n"); 
+ retMCx = NULL; retMCy = NULL; retMCz =NULL; 
+ } 
Error in 1 || rho[3] > 1 || rho[3] <- 1 : target of assignment expands to non-language object 

Toute idée pourquoi? Merci!

Répondre

3

Je commencerais par ajouter des espaces: rho[1] <-1 était supposé être rho[1] < -1 mais ce que vous avez ici est rho[1] <- 1.