Displaying 1 result from an estimated 1 matches for "test_if_else2".
Did you mean:
test_if_else
2003 Nov 13
4
Problem with parser and if/else
...quot;)
} else {
cat("in the else\n")
}
runs fine:
> source("test_if_else.R")
in the if
>
but the code:
x1 <- 1:6
t1 <- 5
if (length(x1) >= t1) {
cat("in the if 2\n")
}
else {
cat("in the else\n")
}
fails with the error:
> source("test_if_else2.R")
Error in parse(file, n, text, prompt) : syntax error on line 6
>
Could someone explain this to me please?
Thanks,
Simon.
--
Dr. Simon Brown Climate extremes research manager
simon.brown at metoffice.com http://www.hadleycentre.com
Telephone: +4...