我想使用read.xls
從因特網導入.xls
文件。我已經調整了線路跳過和編碼,但它仍然不起作用! 有關於此的任何想法? Excel文件是否「髒」?使用read.xls導入「髒」.xls
library("gdata")
read.xls("http://www.gsi-berlin.info/redirectA.asp?filename=TS1200199029201312.xls",
sheet=2, skip=5, fileEncoding="utf8")
我想使用read.xls
從因特網導入.xls
文件。我已經調整了線路跳過和編碼,但它仍然不起作用! 有關於此的任何想法? Excel文件是否「髒」?使用read.xls導入「髒」.xls
library("gdata")
read.xls("http://www.gsi-berlin.info/redirectA.asp?filename=TS1200199029201312.xls",
sheet=2, skip=5, fileEncoding="utf8")
編輯:
嘗試使用readxl
代替。這似乎工作得更好。
library(readxl)
# Need to download the file first
df <- read_excel("/.../TS1200199029201312.xls", sheet=2, skip=5)
head(df)
01011101 Stülerstr. 0.130378
1 01011102 Großer Tiergarten x
2 01011103 Lützowstr. 0.451560
3 01011104 Körnerstr. 0.191847
4 01011105 Nördl. Landwehrkanal x
5 01011201 Wilhelmstr. .
6 01011202 Unter den Linden Nord x
缺少「.xls」的第一行數據,skip = 4不會修復它。此外,編碼被破壞,並添加file.encoding =「utf8」使命令再次錯誤... mhhh ... –
@Gui_struggling_with_R請參閱我的編輯。嘗試使用'readxls'來代替,因爲它需要更少的參數來獲得你想要的,但你必須先下載文件。希望這可以幫助 – Vedda
這裏是什麼*它仍然無法正常工作!*是什麼意思? – pnuts
輸入不起作用。 –