Re: [R] Character entry mismatch in the console window

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon, 05 May 2008 14:39:17 +0100 (BST)

So, you are on Windows (but didn't tell us). Those 'quotes' in your email are the so-called smart quotes -- only ASCII quotation marks are accepted by R.

The change is that R 2.7.0 is actually reading what you pasted into the clipboard, not some converted version (as previous versions of R did, although why that conversion did not send the directional quotes which are in CP1252 is a mystery). You need to sort this out in your OS -- it is best to switch off 'smart quotes' in Word, and do a search-and-replace there (or use a better editor).

On Mon, 5 May 2008, Dennis Hansen wrote:

> Dear R users,
>
> I have just de-installed my old R 2.4.1 and installed R 2.7.0. I downloaded
> this version from the South African mirror, as I am currently working in
> South Africa.
>
> When trying to paste any of my old analyses into the console (I keep them in
> word-documents), I get an error when I first try to load the data with the
> following line (example):
>
> lap.long.dist <-
> read.table(“C:\\Ranalysis\\SouthAfrica\\Lap.oreogena\\lap.long.distance.txt”,
> header = TRUE);
>
> I get the error:
>
> Error: unexpected input in "lap.long.dist <- read.table(“"
>
> Note that (at least on my screen now) the two " (quotation marks) at the end
> of the error message are different. The only way I can make it work is to
> manually go and delete and re-type all the "-characters in my command line in
> R, before pressing enter.
>
> This, to me, suggests that R now for some reason is "mis-matched" or whatever
> you want to call it with the way my computer uses (encodes?) its characters
> in other programmes.

Not 'other programmes', just Word.

> I am sure there is an easy way to correct this in some setting, but despite
> an hour's search on the net and elsewhere, I am no closer to solving the
> problem.
>
> Thanks in advance for any advice!
>
> Dennis
>
> --
>
> Dennis Hansen, PhD
>
> Postdoctoral Scholar
> Department of Biology
> 371 Serra Mall, Gilbert Building, Room 109
> Stanford University
> Stanford, CA 94305-5020
> USA
> -----------------------
> “Everything that shouldn’t be done to an island has been done to Mauritius.
> Except, perhaps, nuclear testing” –Richard Lewis
>
> ______________________________________________
> R-help_at_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.
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


______________________________________________ R-help_at_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.

Received on Mon 05 May 2008 - 13:47:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 05 May 2008 - 14:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive