The R Project SVN R

Rev

Rev 25910 | Rev 29671 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25910 Rev 26901
Line 1... Line 1...
1
 
1
 
2
R : Copyright 2003, The R Development Core Team
2
R : Copyright 2003, The R Foundation for Statistical Computing
3
Version 1.8.0 Under development (unstable) (2003-08-27)
3
Version 1.8.1 alpha (2003-11-06), ISBN 3-900051-00-3
4
 
4
 
5
R is free software and comes with ABSOLUTELY NO WARRANTY.
5
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
You are welcome to redistribute it under certain conditions.
6
You are welcome to redistribute it under certain conditions.
7
Type 'license()' or 'licence()' for distribution details.
7
Type 'license()' or 'licence()' for distribution details.
8
 
8
 
9
R is a collaborative project with many contributors.
9
R is a collaborative project with many contributors.
10
Type 'contributors()' for more information.
10
Type 'contributors()' for more information and
-
 
11
'citation()' on how to cite R in publications.
11
 
12
 
12
Type 'demo()' for some demos, 'help()' for on-line help, or
13
Type 'demo()' for some demos, 'help()' for on-line help, or
13
'help.start()' for a HTML browser interface to help.
14
'help.start()' for a HTML browser interface to help.
14
Type 'q()' to quit R.
15
Type 'q()' to quit R.
15
 
16
 
Line 26... Line 27...
26
+    is.null(nsl("cran.r-project.org"))) q()
27
+    is.null(nsl("cran.r-project.org"))) q()
27
> 
28
> 
28
> # test do_download.
29
> # test do_download.
29
> nrow(CRAN.packages())
30
> nrow(CRAN.packages())
30
trying URL `http://cran.r-project.org/src/contrib/PACKAGES'
31
trying URL `http://cran.r-project.org/src/contrib/PACKAGES'
31
Content type `text/plain; charset=iso-8859-1' length 124178 bytes
32
Content type `text/plain; charset=iso-8859-1' length 134991 bytes
32
opened URL
33
opened URL
33
.......... .......... .......... .......... ..........
34
.......... .......... .......... .......... ..........
34
.......... .......... .......... .......... ..........
35
.......... .......... .......... .......... ..........
35
.......... .......... .
36
.......... .......... .......... .
36
downloaded 121Kb
37
downloaded 131Kb
37
 
38
 
38
[1] 251
39
[1] 273
39
> 
40
> 
40
> # test url connections on http
41
> # test url connections on http
41
> zz <- url("http://cran.r-project.org/")
42
> zz <- url("http://cran.r-project.org/")
42
> readLines(zz)
43
> readLines(zz)
43
 [1] "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">"                       
44
 [1] "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">"                       
Line 68... Line 69...
68
[26] ""                                                                       
69
[26] ""                                                                       
69
> close(zz)
70
> close(zz)
70
> 
71
> 
71
> ## check graceful failure:
72
> ## check graceful failure:
72
> try(zz <- url("http://foo.bar", "r"))
73
> try(zz <- url("http://foo.bar", "r"))
73
unable to resolve 'foo.bar'.
-
 
74
Error in url("http://foo.bar", "r") : unable to open connection
74
Error in url("http://foo.bar", "r") : unable to open connection
-
 
75
In addition: Warning message: 
-
 
76
unable to resolve 'foo.bar'. 
75
> 
77
> 
76
> # and via read.table, test http and ftp.
78
> # and via read.table, test http and ftp.
77
> 
79
> 
78
> read.table("http://www.stats.ox.ac.uk/pub/datasets/csb/ch11b.dat")
80
> read.table("http://www.stats.ox.ac.uk/pub/datasets/csb/ch11b.dat")
79
     V1  V2   V3    V4 V5
81
     V1  V2   V3    V4 V5