以前从URL读取CSV有效,现在返回错误

以前从URL读取CSV有效,现在返回错误,r,noaa,R,Noaa,我有一个程序,我打算以最少的代码操作定期重新运行。下面的代码以前成功运行,但它停止工作。我想,也许服务器关闭了,但当我将URL粘贴到浏览器上时,它启动了csv文件的下载。所以我想我错过了一些东西 nyc_temp_data <- read.csv("https://www.ncei.noaa.gov/access/services/data/v1?dataset=daily-summaries &dataTypes=TMAX&stations=USW00094728&a

我有一个程序,我打算以最少的代码操作定期重新运行。下面的代码以前成功运行,但它停止工作。我想,也许服务器关闭了,但当我将URL粘贴到浏览器上时,它启动了csv文件的下载。所以我想我错过了一些东西

nyc_temp_data <- read.csv("https://www.ncei.noaa.gov/access/services/data/v1?dataset=daily-summaries
  &dataTypes=TMAX&stations=USW00094728&startDate=2014-01-01&endDate=2020-05-01&includeAttributes=true&units=standard&format=csv")

次优解决方案,但完成工作:

# Store the url: csv_url => character vector
csv_url <- "https://www.ncei.noaa.gov/access/services/data/v1?dataset=daily-summaries
&dataTypes=TMAX&stations=USW00094728&startDate=2014-01-01&endDate=2020-05-01&includeAttributes=true&units=standard&format=csv"

# Store the full filepath to the desired output location / filename: 
# output_fpath => character vector
output_fpath <- paste0(getwd(), "/nyc_temp_data.csv")

# Download the url and store it at the filepath: nyc_temp_data.csv => stdout
download.file(csv_url, output_fpath)

# Read in the csv from the file path. nyc_temp_data => data.frame
nyc_temp_data <- read.csv(output_fpath)
#存储url:csv_url=>字符向量
csv_url字符向量
输出路径标准输出
下载文件(csv\u url,输出路径)
#从文件路径读取csv。nyc_temp_data=>data.frame

nyc_temp_data次优解决方案,但完成工作:

# Store the url: csv_url => character vector
csv_url <- "https://www.ncei.noaa.gov/access/services/data/v1?dataset=daily-summaries
&dataTypes=TMAX&stations=USW00094728&startDate=2014-01-01&endDate=2020-05-01&includeAttributes=true&units=standard&format=csv"

# Store the full filepath to the desired output location / filename: 
# output_fpath => character vector
output_fpath <- paste0(getwd(), "/nyc_temp_data.csv")

# Download the url and store it at the filepath: nyc_temp_data.csv => stdout
download.file(csv_url, output_fpath)

# Read in the csv from the file path. nyc_temp_data => data.frame
nyc_temp_data <- read.csv(output_fpath)
#存储url:csv_url=>字符向量
csv_url字符向量
输出路径标准输出
下载文件(csv\u url,输出路径)
#从文件路径读取csv。nyc_temp_data=>data.frame
纽约市温度数据