[R] problem with simple if() statement

Colin Beale c.beale at macaulay.ac.uk
Mon Feb 6 11:25:15 CET 2006


Norman, 
you probably want:
 
  if (seq[i] == "A") m <- trans[1,]
  
hth,
Colin

>>> Norman Goodacre <taranpen at yahoo.co.uk> 06/02/2006 06:22 >>>
the following code apprantely, for some grand old reason, induces a
syntax error:
  
  if (seq[i] = "A") m <- trans[1,]
  
  where seq is a vector and trans is a matrix. I cannot for the life of
me see why this is wrong. Syntax error is: 
  
  Error: syntax error in "if (seq[i] ="
  
  Sincerely,
  
  Norman Goodacre
  
  
		
---------------------------------

---------------------------------
  
	[[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




More information about the R-help mailing list