读取外部文件,比如github。
- 首先找到你要下载问价你的链接
- 下载链接
read.csv(file = 'https://raw.githubusercontent.com/mhurtgen/datascience/b409f2f70868a3391e372f930053eeb1beca029a/ENB2012_data.csv')
> head(read.csv(file = 'https://raw.githubusercontent.com/mhurtgen/datascience/b409f2f70868a3391e372f930053eeb1beca029a/ENB2012_data.csv'))
X1 X2 X3 X4 X5 X6 X7 X8 Y1 Y2
1 0,98 514,50 294,00 110,25 7,00 2 0,00 0 15,55 21,33
2 0,98 514,50 294,00 110,25 7,00 3 0,00 0 15,55 21,33
3 0,98 514,50 294,00 110,25 7,00 4 0,00 0 15,55 21,33
4 0,98 514,50 294,00 110,25 7,00 5 0,00 0 15,55 21,33
5 0,90 563,50 318,50 122,50 7,00 2 0,00 0 20,84 28,28
6 0,90 563,50 318,50 122,50 7,00 3 0,00 0 21,46 25,38