[R] Strange error

Jim Lemon drjimlemon at gmail.com
Fri Dec 4 08:34:31 CET 2015

Hi Nick,
I think that Jeff may be correct in that the code was cut and pasted from a
non-text application. In particular, the error message about "*" is
suspicious. What may be happening is that when you select a single line, it
only picks up the text, but when you select multiple lines, the garbage
bytes come along for the ride. Since you seem to be using Windows, try
Notepad (text editor) for an external editor as it is usually better
behaved. The final error is the result of not having read the data into GWS.


On Thu, Dec 3, 2015 at 10:59 PM, Nicolae Doban <nickdoban at gmail.com> wrote:

> Hi,
> recently I received a strange error after running my code in chunks. But, I
> don't get any errors when I run it line by line.
> Also, what is strange is that the  error message is misspelled
> This is the error messages I get
> *> setwd("H:/XX/XXX")*
> *"rror: unexpected input in "setwd("H:/XX/XXX")*
> *> *
> *"rror: unexpected input in "*
> *> GWS <- read.csv("X.csv", header = TRUE, sep = ",", stringsAsFactors =
> FALSE, na.strings=c("","","NA"))*
> *"rror: unexpected input in "GWS <- read.csv("X.csv", header = TRUE, sep =
> ",", stringsAsFactors = FALSE, na.strings=c("","","NA"))*
> *> GWS <- GWS[with(GWS, order(d)), ]; row.names(GWS) <- NULL*
> *Error: object 'GWS' not found*
> As you can see even changing the directory results in an error message but,
> it changes the directory to the correct folder.
> What is interesting is that I was not getting this error yesterday (Dec.,
> 2nd 2015)
> Could you please shed some light on this issue? Is it something related to
> R or Rstudio or the packages?
> Thank you in advance very much,
> nick
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

	[[alternative HTML version deleted]]

More information about the R-help mailing list