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

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to