In the following code, I got the "target of assignment expands to non-language object" error:
> 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
Any idea why? Thanks!