[R] How to read a text table? A bit of trouble with Using R - An Introduction

John Maindonald john.maindonald at anu.edu.au
Tue Feb 27 22:36:57 CET 2001


Mark Myatt wrote

>Type the file like this:
>
>"Year" "NSW" "Vic." "Qld" "SA" "WA" "Tas." "NT" "ACT" "Aust."
>1917 1904 1409  683  440  306 193   5   3  4941
>1927 2402 1727  873  565  392 211   4   8  6182
>1937 2693 1853  993  589  457 233   6  11  6836
>1947 2985 2055 1106  646  502 257  11   4  1947
>1957 3625 2656 1413  873  688 326  21  38  9640
>1967 4295 3274 1700 1110  879 375  62 103 11799
>1977 5002 3837 2130 1286 1204 415 104 214 14192
>1987 5617 4210 2675 1393 1496 449 158 265 16264
>1997 6274 4605 3401 1480 1798 474 187 310 18532
>
>Note the double quotes round the column labels and the space (not TAB)
>between each item of data. You can line them up with spaces (as above)
>or just use a single space.

Actually the quotes around the column headers are not necessary,
unless the names contain spaces.

John Maindonald               email : john.maindonald at anu.edu.au
Statistical Consulting Unit,  phone : (6125)3998
c/o CMA, SMS,                 fax   : (6125)5549
John Dedman Mathematical Sciences Building
Australian National University
Canberra ACT 0200
Australia

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list