R:直接从网站读取 .DAT 文件时出错
R: Error in Reading a .DAT file directly from website
我正在尝试直接从 website 读取 .DAT
文件并收到以下错误:
abdomen <- read.table("https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat")
Error in file(file, "rt") :
cannot open the connection to 'https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat'
In addition: Warning messages:
1: In eval(formal.args[[as.character(substitute(arg))]], envir = sys.frame(sysP)) :
closing unused connection 4 (https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat)
2: In file(file, "rt") :
URL 'https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat': status was 'Peer certificate cannot be authenticated with given CA certificates'
我也试过下面的代码:
abdomen <- read.table(url("https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat"))
Error in open.connection(file, "rt") :
cannot open the connection to 'https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat'
In addition: Warning message:
In open.connection(file, "rt") :
URL 'https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat': status was 'Peer certificate cannot be authenticated with given CA certificates'
任何提示,请。
您很可能被您的(公司?)防火墙阻止了。确保您的代理设置工作正常。
盗用我自己在 :
上的回答
## get the proxy settings
system("netsh winhttp show proxy")
Sys.setenv(HTTP_PROXY = <the proxy from netsh>, HTTPS_PROXY = <the proxy from netsh>)
我正在尝试直接从 website 读取 .DAT
文件并收到以下错误:
abdomen <- read.table("https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat")
Error in file(file, "rt") :
cannot open the connection to 'https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat'
In addition: Warning messages:
1: In eval(formal.args[[as.character(substitute(arg))]], envir = sys.frame(sysP)) :
closing unused connection 4 (https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat)
2: In file(file, "rt") :
URL 'https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat': status was 'Peer certificate cannot be authenticated with given CA certificates'
我也试过下面的代码:
abdomen <- read.table(url("https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat"))
Error in open.connection(file, "rt") :
cannot open the connection to 'https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat'
In addition: Warning message:
In open.connection(file, "rt") :
URL 'https://www2.stat.duke.edu/courses/Spring03/sta113/Data/Hand/abdomen.dat': status was 'Peer certificate cannot be authenticated with given CA certificates'
任何提示,请。
您很可能被您的(公司?)防火墙阻止了。确保您的代理设置工作正常。
盗用我自己在
## get the proxy settings
system("netsh winhttp show proxy")
Sys.setenv(HTTP_PROXY = <the proxy from netsh>, HTTPS_PROXY = <the proxy from netsh>)