cannot open connection: Authorization Required

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

cannot open connection: Authorization Required

Spencer Graves
Hi, All:

      Is there a way in R to access a file / web site that requires

      Consider for example the following:

> readLines('', 4)
[1] "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"
[2] "<html>"
[3] "<head>"
[4] "<title>The R Project for Statistical Computing</title>"

> readLines(URL) # URL = web address, which I can see via manual access.
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open: HTTP status was '401 Authorization Required'

      Spencer Graves

 > sessionInfo()
R version 2.7.2 (2008-08-25)

LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

[hidden email] mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.