[R] Accessing data via url

John Kane jrkrideau at yahoo.ca
Fri Jan 7 18:44:05 CET 2011


This seems to get me something (the binary format)  but what do I do with it?

Thanks to everyone for the help.

Results:  Original dd file on my hard drive:

mydd <- structure(list(AUA9363 = structure(c(1L, 1L, 2L, 3L, 3L, 4L,
4L, 4L, 6L, 5L, 5L), .Label = c("AUA9733", "AUA9734", "JAF104",
"KLM686", "KLM744", "KLM783"), class = "factor"), OE.LNQ = structure(c(5L,
5L, 5L, 1L, 1L, 2L, 2L, 2L, 3L, 4L, 4L), .Label = c("  OO-TUC",
"  PH-BFF", "  PH-BFH", "  PH-BQD", " OE-LVK"), class = "factor"),
    X51.30 = c(50.82, 50.82, 50.74, 50.74, 50.75, 50.73, 50.84,
    50.86, 50.94, 50.66, 50.75), X.3.01 = c(-3.12, -3.14, -3.17,
    -3.18, -3.05, -3.96, -3.37, -3.28, -4, -3.92, -3.25), X3575 = c(3775L,
    3625L, 5575L, 38000L, 38000L, 38975L, 39000L, 39000L, 39000L,
    37000L, 36300L), X09.21.44 = structure(c(4L, 5L, 6L, 2L,
    3L, 8L, 10L, 11L, 1L, 7L, 9L), .Label = c(" 05:44:12", " 07:50:08",
    " 07:50:44", " 08:02:34", " 08:02:47", " 08:57:12", " 13:22:37",
    " 13:23:11", " 13:25:42", " 13:25:51", " 13:26:15"), class = "factor")), .Names = c("AUA9363",
"OE.LNQ", "X51.30", "X.3.01", "X3575", "X09.21.44"), class = "data.frame", row.names = c(NA,
-11L))


Downloaded result
 x
  [1] 3c 48 54 4d 4c 3e 0a 3c 48 45 41 44 3e 0a 3c 54 49 54 4c 45 3e 4d 6f 76 65 64 20 54 65 6d 70 6f 72
 [34] 61 72 69 6c 79 3c 2f 54 49 54 4c 45 3e 0a 3c 2f 48 45 41 44 3e 0a 3c 42 4f 44 59 20 42 47 43 4f 4c
 [67] 4f 52 3d 22 23 46 46 46 46 46 46 22 20 54 45 58 54 3d 22 23 30 30 30 30 30 30 22 3e 0a 3c 48 31 3e
[100] 4d 6f 76 65 64 20 54 65 6d 70 6f 72 61 72 69 6c 79 3c 2f 48 31 3e 0a 54 68 65 20 64 6f 63 75 6d 65
[133] 6e 74 20 68 61 73 20 6d 6f 76 65 64 20 3c 41 20 48 52 45 46 3d 22 68 74 74 70 73 3a 2f 2f 73 69 74
[166] 65 73 2e 67 6f 6f 67 6c 65 2e 63 6f 6d 2f 73 69 74 65 2f 6a 72 6b 72 69 64 65 61 75 2f 68 6f 6d 65
[199] 2f 67 65 6e 65 72 61 6c 2d 73 74 6f 72 65 73 2f 64 75 70 6c 69 63 61 74 65 73 2e 63 73 76 3f 61 74
[232] 74 72 65 64 69 72 65 63 74 73 3d 30 22 3e 68 65 72 65 3c 2f 41 3e 2e 0a 3c 2f 42 4f 44 59 3e 0a 3c
[265] 2f 48 54 4d 4c 3e 0a




--- On Fri, 1/7/11, Henrique Dallazuanna <wwwhsd at gmail.com> wrote:

> From: Henrique Dallazuanna <wwwhsd at gmail.com>
> Subject: Re: [R] Accessing data via url
> To: "Dieter Menne" <dieter.menne at menne-biomed.de>
> Cc: r-help at r-project.org
> Received: Friday, January 7, 2011, 7:07 AM
> With the ssl.verifypeer = FALSE
> argument it works:
> 
>  x = getBinaryURL(dd, ssl.verifypeer = FALSE)
> 
> 
> On Fri, Jan 7, 2011 at 6:24 AM, Dieter Menne
> <dieter.menne at menne-biomed.de>wrote:
> 
> >
> >
> > John Kane-2 wrote:
> > >
> > > #   Can anyone suggest why this
> works
> > >
> > > datafilename <-
> > > "http://personality-project.org/r/datasets/maps.mixx.epi.bfi.data"
> > > person.data  <-
> read.table(datafilename,header=TRUE)
> > >
> > > # but this does not?
> > >
> > > dd <-
> > > "https://sites.google.com/site/jrkrideau/home/general-stores/trees.txt"
> > > treedata <- read.table(dd, header=TRUE)
> > >
> > >
> ===================================================================
> > >
> > > Error in file(file, "rt") : cannot open the
> connection
> > >
> >
> > Your original file is no longer there, but when I try
> RCurl with a png file
> > that is present, I get a certificate error:
> >
> > Dieter
> >
> > --------
> > library(RCurl)
> > sessionInfo()
> > dd <-
> > "https://sites.google.com/site/jrkrideau/home/general-stores/history.png"
> > x = getBinaryURL(dd)
> >
> > -------------
> > > sessionInfo()
> > R version 2.12.1 (2010-12-16)
> > Platform: i386-pc-mingw32/i386 (32-bit)
> >
> > locale:
> > [1] LC_COLLATE=German_Germany.1252 
> LC_CTYPE=German_Germany.1252
> > [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
> > [5] LC_TIME=German_Germany.1252
> >
> > attached base packages:
> > [1] stats     graphics 
> grDevices datasets  utils 
>    methods   base
> >
> > other attached packages:
> > [1] RCurl_1.5-0.1  bitops_1.0-4.1
> >
> > loaded via a namespace (and not attached):
> > [1] tools_2.12.1
> >
> > > dd <-
> > > "https://sites.google.com/site/jrkrideau/home/general-stores/history.png
> > "
> >
> > > x = getBinaryURL(dd)
> > Error in curlPerform(curl = curl, .opts = opts,
> .encoding = .encoding) :
> >  SSL certificate problem, verify that the CA cert
> is OK. Details:
> > error:14090086:SSL
> routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
> > failed
> >
> >
> >
> > --
> > View this message in context:
> > http://r.789695.n4.nabble.com/Accessing-data-via-url-tp3178094p3178773.html
> > Sent from the R help mailing list archive at
> Nabble.com.
> >
> > ______________________________________________
> > 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.
> >
> 
> 
> 
> -- 
> Henrique Dallazuanna
> Curitiba-Paraná-Brasil
> 25° 25' 40" S 49° 16' 22" O
> 
>     [[alternative HTML version deleted]]
> 
> 
> -----Inline Attachment Follows-----
> 
> ______________________________________________
> 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.
> 





More information about the R-help mailing list