[R] Graphical Display of Values' Distribution

Ben Bolker bolker at ufl.edu
Wed Sep 17 20:42:49 CEST 2008

Steve Murray <smurray444 <at> hotmail.com> writes:

> Dear all,
> I have a column within a dataframe of values which range between 1 and 2. I
want to display graphically the
> distribution of these values (i.e. are they clustered towards either exteme?
Or spread evenly?). What is
> a good way of doing this in R?
> I've tried a few things, including using the 'hist' command, but receive the
following error message:
> > hist(urban.long[3])
> Error in hist.default(urban.long[3]) : 'x' must be numeric
> ...which is strange because all the values *are* numeric!

  hist, plot(density(x)), rug ...

  are you sure that your column really is numeric and hasn't
gotten turned into a factor because of a glitch?  what do you
get from class(urban.long[3]) ?

  Ben Bolker

More information about the R-help mailing list