crubba / htmltab

An R package for assembling data frames from HTML tables (fka htmltable)
Other
26 stars 7 forks source link

Dimension Error "dimnames not equal to array extent" #7

Open JSB97 opened 9 years ago

JSB97 commented 9 years ago

Another problem parsing what should be a simpler example. Language isnt the issue; I can parse simple (tables without spanning cells) correctly. I added some more markup to identify the table header; and pass this into the calling function below. Despite this, htmltab cannot recognized the header

https://www.dropbox.com/home/Public?preview=6501.Yuho.pdf_table_30.html

R Code

u4 <- "/SomePath/6501.Yuho.pdf_table_30.html" t4 <- htmltab(doc = u4,header="/html/body/table/thead")

Warning messages: 1: Argument 'which' left unspecified. Choosing first table. 2: No header generated. Try passing information to header or colNames. Header XPath was /html/body/table/thead

head(t4)

                       V2                 V3               V4       V5       V6

1 機械装置及び 工具器具備品 土 地 (面積千㎡) リース 資産 その他 合 計 2 86,975 70,265 32,050 (1,686) 16,751 3,951 3 24,701 14,795 84,814 (8,468) 7,419 14,105 4 97,340 58,002 30,259 (3,739) 9,512 8,274 5 62,131 35,556 41,975 (2,093) 597 2,673 6 95,331 122,966 59,537 (9,497) 3,137 14,586