The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

tenasakai (7) [Avatar] Offline
#1
Hi,

I am having a problem working through the example shown in Listing 4.7 (page 77):

> options(digit=2)
> z <- scale( roster[,2:4])
Error in scale(roster[, 2:4]) : object 'roster' not found
>

Am I missing a library or package?

Regards,

Tena Sakai
robert.kabacoff (170) [Avatar] Offline
#2
Re: Listing 4.7 (Section 4.3)
Hi Tena,

Sorry for the confusion. The listing assumes that you have entered the data from Table 4.1 into a dataframe called roster. I did not include that in the code. When the book is published, my expectation is that the data will included in the source code.

In the mean time, you can use the comma delimited text file that I have attached.

Read it into R as a dataframe using

roster <- read.table("table4-1.csv", sep=",", header=TRUE, as.is=TRUE)

We need the as.is=TRUE option to keep student names from being turned into factor.

Hope this helps.

Sincerely,

Rob
tenasakai (7) [Avatar] Offline
#3
Re: Listing 4.7 (Section 4.3)
Many thanks, Dr Kabacoff.

There is so much satisfaction in working through examples.

Regards,

Tena Sakai
robert.kabacoff (170) [Avatar] Offline
#4
Re: Listing 4.7 (Section 4.3)
My pleasure!

Rob