Загрузите почтовый файл в R - PullRequest
0 голосов
/ 05 марта 2019

Я получаю следующую ошибку: Error in file (file, "rt"): cannot open the connection

download.file("http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Research_Data_5_Factors_2x3_CSV.zip", destfile="F-F_Research_Data_5_Factors_2x3_CSV.zip")

unzip("F-F_Research_Data_5_Factors_2x3_CSV.zip")

unzip("F-F_Research_Data_5_Factors_2x3_WIRELESS_CSV.zip")

data <- read.delim("F-F_Research_Data_5_Factors_2x3_Wireless_CSV.TXT", sep = "|")

1 Ответ

0 голосов
/ 09 марта 2019

Мне удалось прочитать в наборе данных с:

download(url="http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Research_Data_5_Factors_2x3_daily_CSV.zip", dest="<directory and filename>/F-F_Research_Data_5_Factors_2x3_daily_CSV.zip", mode="wb") 
unzip ("<directory and filename>/F-F_Research_Data_5_Factors_2x3_daily_CSV.zip", exdir = "Yourfilename")

x <- read_csv("<directory and filename>/F-F_Research_Data_5_Factors_2x3_daily.CSV", skip = 3)

x %>%
  mutate_at(vars(-X1), funs(./100))
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...