Skip to content

read_wiki_table() and read_all_tables() read the same table differently #6

@rporta23

Description

@rporta23

The "binary" column for this table should have seven digits. When I read in the same table using read_wiki_table() and read_all_tables(), read_wiki_table() reads this column correctly, but read_all_tables() only keeps one digit for each observation in the column. Also, read_all_tables() gets rid of the header row, and read_wiki_table() does not. (I'm not sure if this is intentional).

library(wikitablr)
library(tidyverse)

ASCII_1 <- read_wiki_table("https://en.wikipedia.org/wiki/ASCII")
head(ASCII_1, n = 5)
#>     binary oct dec hex abbreviation abbreviation_1 abbreviation_2  x_2
#> 1   Binary Oct Dec Hex         1963   Abbreviation   Abbreviation <NA>
#> 2 000 0000 000   0  00         NULL            NUL            NUL   ^@
#> 3 000 0001 001   1  01          SOM            SOH            SOH   ^A
#> 4 000 0010 002   2  02          EOA            STX            STX   ^B
#> 5 000 0011 003   3  03          EOM            ETX            ETX   ^C
#>    x_3        name_1967
#> 1 1965             1967
#> 2  \\0             Null
#> 3 <NA> Start of Heading
#> 4 <NA>    Start of Text
#> 5 <NA>      End of Text
ASCII <- read_all_tables("https://en.wikipedia.org/wiki/ASCII")
head(ASCII[[1]], n = 5)
#>   binary oct dec hex abbreviation abbreviation_1 abbreviation_2 x_2  x_3
#> 1      0   0   0  00         NULL            NUL            NUL  ^@  \\0
#> 2      0   1   1  01          SOM            SOH            SOH  ^A <NA>
#> 3      0   2   2  02          EOA            STX            STX  ^B <NA>
#> 4      0   3   3  03          EOM            ETX            ETX  ^C <NA>
#> 5      0   4   4  04          EOT            EOT            EOT  ^D <NA>
#>             name_1967
#> 1                Null
#> 2    Start of Heading
#> 3       Start of Text
#> 4         End of Text
#> 5 End of Transmission

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions