Hi, All: Is there a way in R to access a file / web site that requires permission? Consider for example the following: > readLines('http://www.r-project.org/', 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' Thanks, Spencer Graves
Hi, All: Is there a way in R to access a file / web site that requires permission? Consider for example the following:> readLines('http://www.r-project.org/', 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' Thanks, Spencer Graves > sessionInfo() R version 2.7.2 (2008-08-25) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base
Bernardo Rangel Tura
2008-Oct-05 13:37 UTC
[R] cannot open connection: Authorization Required
Em Sex, 2008-10-03 ?s 11:22 -0700, Spencer Graves escreveu:> Hi, All: > > Is there a way in R to access a file / web site that requires > permission? > > Consider for example the following: > > > > readLines('http://www.r-project.org/', 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' > > > Thanks, > Spencer GravesSpencer, this is a local problem in my system> > > readLines('http://www.r-project.org/') > [1] "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" > [2] "<html>" > [3] "<head>" > [4] "<title>The R Project for Statistical Computing</title>" > [5] "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">" > [6] "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">" > [7] "<link rel=\"stylesheet\" type=\"text/css\" href=\"R.css\">" > [8] "</head>" > [9] "" > [10] "<FRAMESET cols=\"1*, 4*\" border=0>" > [11] "<FRAMESET rows=\"120, 1*\">" > [12] "<FRAME src=\"logo.html\" name=\"logo\" frameborder=0>" > [13] "<FRAME src=\"navbar.html\" name=\"contents\" frameborder=0>" > [14] "</FRAMESET>" > [15] "<FRAME src=\"main.shtml\" name=\"banner\" frameborder=0>" > [16] "<noframes>" > [17] "<h1>The R Project for Statistical Computing</h1>" > [18] "" > [19] "Your browser seems not to support frames," > [20] "here is the <A href=\"navbar.html\">contents page</A> of the R Project's" > [21] "website." > [22] "</noframes>" > [23] "</FRAMESET>" > [24] "" > [25] "" > [26] ""I run R.2.7.2 in Ubuntu AMD 64 machine -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil