Message-ID: <BAY135-W31CEC8865608B4F5219EC7884C0@phx.gbl>
Date: 2008-09-17T18:52:30Z
From: Steve Murray
Subject: Graphical Display of Values' Distribution
In-Reply-To: <317737de0809171040k5d1d3781y13fde873575bef7c@mail.gmail.com>
Dear Phil and Jorge,
Many thanks for your quick replies. I found that:> hist(urban.long[,3]) worked and displayed the data as I hoped. This reveals that the data are strongly distributed towards the value '1', and the other bars on the histogram are difficult to distinguish from each other as they are very small.
I therefore wish to examine all values of urban.long[,3] which are greater than 1. I have tried the following, but receive error messages each time:
> hist(urban.long[,3]>1)
Error in hist.default(urban.long[, 3]> 1) : 'x' must be numeric
> hist(urban.long[urban.long[,3]>1])
Error in `[.data.frame`(urban.long, urban.long[, 3]> 1) :
undefined columns selected
> hist(urban.long[urban.long[,3]>1])
Error in `[.data.frame`(urban.long, urban.long[, 3]> 1) :
undefined columns selected
> hist(as.numeric(urban.long[urban.long[,3]>1]))
Error in `[.data.frame`(urban.long, urban.long[, 3]> 1) :
undefined columns selected
> hist(as.numeric(as.character(urban.long[urban.long[,3]>1])))
Error in `[.data.frame`(urban.long, urban.long[, 3]> 1) :
undefined columns selected
Here is some information about the data:
> class(urban.long[,3])
[1] "numeric"
> str(urban.long[,3])
num [1:67609] 1 1 1 1 1 1 1 1 1 1 ...
I'm probably doing something fairly obvious wrong - if anyone could point this out to me then I'd be very thankful!
Many thanks again,
Steve