Can somebody explain the problem in the following expression? Thank you
/> if (species == 1){ + fitness <- (1-b)*exp(-((microsites-niche.preference)/(niche.width.specialist+a.specialist)^2)*(1-a.specialist) + }else Error: unexpected '}' in: " fitness <- (1-b)*exp(-((microsites-niche.preference)/(niche.width.specialist+a.specialist)^2)*(1-a.specialist) }" > if (species ==2){ + fitness <) (1-b)*exp(-((microsites-niche.preference)/(niche.width.generalist+a.generalist)^2)*(1-a.generalist) Error: unexpected ')' in: " if (species ==2){ fitness <)" > } else fitness <- 0 Error: unexpected '}' in " }" > } Error: unexpected '}' in " }"/ -- View this message in context: http://r.789695.n4.nabble.com/IF-ELSE-tp4292285p4292285.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.