Using R - unexpected end of input in
Posted: Mon Jan 11, 2021 8:40 am
Hello,
I have an error using this R code from Eviews 11. If I put all the if code under one line, there is no issue (the code below also works in R Studio of course). There is also this kind of error using for loop in multiple lines.
The error message:
R returned an error
Error: unexpected end of input in "if (a==10) {" in "IF (A==10) {"
on line 6.
As I said, this works:
I have an error using this R code from Eviews 11. If I put all the if code under one line, there is no issue (the code below also works in R Studio of course). There is also this kind of error using for loop in multiple lines.
Code: Select all
xopen(type=r)
xon
a<-10
if (a==10) {
cat('\nYes')
} else {
cat('\nNo')
}
xoff
xclose
The error message:
R returned an error
Error: unexpected end of input in "if (a==10) {" in "IF (A==10) {"
on line 6.
As I said, this works:
Code: Select all
xopen(type=r)
xon
a<-10
if (a==10) { cat('\nYes')} else { cat('\nNo')}
xoff
xclose