Re: [R] Error occurring

2016-11-24 Thread Jeff Newmiller
If I was to make a totally wild leap, I would say it looks like someone using an inappropriate text editor such as Microsoft Word to edit R code. Stuti, please carefully read and follow the recommendations in the Posting Guide mentioned at the bottom of this and every post on this mailing list

Re: [R] Error occurring

2016-11-24 Thread Jim Lemon
`Hi Stuti, Your problem is that if you want to have more than one command on a single line, you must separate them with a semicolon. j <- function() { if(!exists ("a")){ a <- 1 } else{ a <- a+1 }; print(a)} The above will work, but is usually considered bad form. What follows is usually easie

Re: [R] Error occurring

2016-11-24 Thread Rui Barradas
Hello, I don't see the error you mention. j <- function() { if(!exists ("a")){ a <- 1 } else{ a <- a+1 } print(a) } j() [1] 1 sessionInfo() R version 3.3.2 (2016-10-31) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Wi