R recipes

Cumulative probability distribution graph

Assume data is in the first variable of the data frame tz

n <- length(tz$V1)
plot(sort(tz$V1), (1:n)/n, type="s")

This will plot a no-frills cumulative probability distribution graph.

Histogram

Assume data is in the first variable of the data frame tz

hist(tz$V1, nclass=60)

This will plot a histogram with 60 buckets. If you leave nclass off, then R will compute what it thinks a reasonable bucket count and bucket width are. Note that you can also supply a vector declaring the width of each bucket.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>