[R] Plotting histogram of RT data

Peter Ehlers ehlers at ucalgary.ca
Sun Mar 31 18:21:01 CEST 2013


On 2013-03-31 04:12, Jacob Fake wrote:
> Hey there,
>
> I'm relatively new to R, and am currently working my way through some basic
> tutorials. I have a large data set that I've been able to import into the
> program. I'm using a script in which x=readdir (the directory). I am trying
> to create a histogram of the data in the 17th column, which is response
> time data ranging from ~200 to 15000. I have tried to create a histogram by
> entering hist(x[,17]). However, the output that I receive has an x-axis
> that is wayyy out with small values like 0e+00 up to 6e+05. All the data is
> clustered together in one bar at 0e+00 and has a frequency of 15000 on the
> y-axis. What am I doing wrong? How can I change the output so that I can
> assess the shape of the distribution?

I'm confused: is 'x' a data.frame or a directory? What exactly does
x[, 17] mean here?

If x is a data.frame, then the first thing to check is

  range(x[, 17])

It's also _always_ a good idea to check str(x) before you do anything
further with x.

Peter Ehlers

>
> 	[[alternative HTML version deleted]]



More information about the R-help mailing list