[R] Problem with scan() from UTF-8 encoded URL

EUROPOL hkiws at gmx.de
Mon Dec 3 17:51:07 CET 2007


Hallo,

I am trying to import a website and structure it from within R:

The following code:

data <-
scan(file='http://en.wikipedia.org/wiki/Special:Recentchanges',what='character')

results in the error:

Error in file(file, "r") : unable to open connection
In addition: Warning message:
cannot open: HTTP status was '403 Forbidden' in: file(file, "r")

It seems that the error is connected to the UTF-8-format of wikipedia,
since the following line works:

data <- scan(file='http://www.google.de',what='character')

I am looking forward to your answers.

Greetings

Marc Schwenzer



More information about the R-help mailing list