> myotis at cix.compulink.co.uk (Graham Smith) writes:
>
>> I apologise for this question, as I'm sure the answer has got to be
>> obvious, but I am trying to follow the John Maindonald tutorial and
have >> stumbled at the first page.
>
>Link? (I suppose that I could find it, but it is you problem...)
http://wwwmaths.anu.edu.au/~johnm/r/dsets/
>> I have sussed out that I need to use the source command rather than
>> the
>> read.table command as illustrated in the tutorial, but the data
isn't
>> reading in properly with additional names at the beginning and end of
the >> data. $value and $visible. I am obviously missing something here and
would >> appreciate some help on what I'm doing wrong.
>> Many thanks,
>>
>> Graham S
>>
>>
>> > austpop<- source ("austpop.r")
>> > austpop
>> $value
>> Year NSW Vic. Qld SA WA Tas. NT ACT Aust.
>> 1 1917 1904 1409 683 440 306 193 5 3 4941
>> 2 1927 2402 1727 873 565 392 211 4 8 6182
>> 3 1937 2693 1853 993 589 457 233 6 11 6836
>> 4 1947 2985 2055 1106 646 502 257 11 17 7579
>> 5 1957 3625 2656 1413 873 688 326 21 38 9640
>> 6 1967 4295 3274 1700 1110 879 375 62 103 11799
>> 7 1977 5002 3837 2130 1286 1204 415 104 214 14192
>> 8 1987 5617 4210 2675 1393 1496 449 158 265 16264
>> 9 1997 6274 4605 3401 1480 1798 474 187 310 18532
>>
>> $visible
>> [1] FALSE
Where did you get the austpop.r? If you got it from the URL I pasted
above, then you shouldn't have this problem. The austpop.R from the URL
does not have what you put above, it is like:
"austpop" <-
structure(list(Year = c(1917, 1927, 1937, 1947, 1957, 1967, 1977,
1987, 1997), NSW = c(1904, 2402, 2693, 2985, 3625, 4295, 5002,
5617, 6274), Vic. = c(1409, 1727, 1853, 2055, 2656, 3274, 3837,
4210, 4605), Qld = c(683, 873, 993, 1106, 1413, 1700, 2130, 2675,
3401), SA = c(440, 565, 589, 646, 873, 1110, 1286, 1393, 1480
), WA = c(306, 392, 457, 502, 688, 879, 1204, 1496, 1798), Tas. = c(193,
211, 233, 257, 326, 375, 415, 449, 474), NT = c(5, 4, 6, 11,
21, 62, 104, 158, 187), ACT = c(3, 8, 11, 17, 38, 103, 214, 265,
310), Aust. = c(4941, 6182, 6836, 7579, 9640, 11799, 14192, 16264,
18532)), .Names = c("Year", "NSW", "Vic.",
"Qld", "SA", "WA",
"Tas.", "NT", "ACT", "Aust."), class =
"data.frame", row.names = c("1",
"2", "3", "4", "5", "6",
"7", "8", "9"))
You should source this (and only this) in.
Cheers,
Ko-Kang Wang
------------------------------------------------------------------------------
Ko-Kang Kevin Wang
Postgraduate PGDipSci Student (Summer Research Assistant)
Department of Statistics
University of Auckland
New Zealand
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._