Re: [R] getting numeric arrays from data frame

2008-04-07 Thread John Fox
, Ontario, Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] project.org] On Behalf Of Mark Farnell Sent: April-06-08 11:15 PM To: r-help@r-project.org Subject: [R] getting numeric arrays from data frame

[R] getting numeric arrays from data frame

2008-04-06 Thread Mark Farnell
Currently I invoke: foo - read.table(foo.data, header=TRUE) to read a table into foo Then when I try to plot a histogram out of the 5th column of foo: hist(foo[5]) It fails and it says: Error in hist.default(foo[5]) : 'x' must be numeric Then I tried: typeof(foo[5]) [1] List So how can I

Re: [R] getting numeric arrays from data frame

2008-04-06 Thread talepanda
try hist(foo[,5]) plot(foo[,c(1,5)]) HTH Currently I invoke: foo - read.table(foo.data, header=TRUE) to read a table into foo Then when I try to plot a histogram out of the 5th column of foo: hist(foo[5]) It fails and it says: Error in hist.default(foo[5]) : 'x' must be