File: internet.R

package info (click to toggle)
r-base 4.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 112,924 kB
  • sloc: ansic: 291,338; fortran: 111,889; javascript: 14,798; yacc: 6,154; sh: 5,689; makefile: 5,239; tcl: 4,562; perl: 963; objc: 791; f90: 758; asm: 258; java: 31; sed: 1
file content (23 lines) | stat: -rw-r--r-- 660 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## These are tests that require a working Internet connection.
## We attempt to test for that on Unix.

if(.Platform$OS.type == "unix" &&
   is.null(nsl("cran.r-project.org"))) q()

## As virtually all http sites redirect to https:, we only test the latter

# test do_download (and "record" #{packages}):
ap <- available.packages(contrib.url("https://cran.r-project.org"))
## IGNORE_RDIFF_BEGIN
nrow(ap)
## IGNORE_RDIFF_END

# test url connections
zz <- url("https://cran.r-project.org/")
readLines(zz)
close(zz)

# and via read.table, using an r-project.org site
read.table("https://developer.R-project.org/inet-tests/ch11b.dat")

showConnections(all = TRUE)