Skip to content

Creating a histogram properly

3 messages · Joe Carl, Joshua Wiley, Dennis Murphy

#
Hello all,

I'm trying to make a histogram of the data contained in my dataframe.
The summary of the data gives me exactly what I want

summary (Data)
V1     V2
first001: 3   last001: 9
first002: 3   last002: 7
first003: 2   last003: 6
(Other) :52    (Other): 27

But how do I capture the names and values in vectors so I can plot them?
#
What about?

hist(Data$V1)
hist(Data$V2)

Cheers,

Josh
On Mon, Oct 24, 2011 at 9:38 AM, Joe Carl <joseph.w.carl.jr at gmail.com> wrote:
--
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/
#
Hi:

Aren't V1 and V2 factors in this data frame? If so, you should be
plotting bar charts rather than histograms (they're not the same). Do
you want separate graphs for V1 and V2, do you want them stacked, or
do you want them dodged (side-by side for each level 001, 002, 003)?
In the absence of such information, it's difficult to tell you how to plot them.

Dennis
On Mon, Oct 24, 2011 at 9:38 AM, Joe Carl <joseph.w.carl.jr at gmail.com> wrote: