histogram help please

I am in statistics class and for the life of me cannot figure out how to code a histogram from my file
the file is

download.file("http://www.openintro.org/stat/data/bdims.RData", destfile = "bdims.RData")
load("bdims.RData")

I need to plot the males height and the females height M=0 F=1 How do I do that? I am so confused and ready to quit.

What have you tried?

You should change the title so that it is briefly explains what you are trying to do (histogram).

I have tried hist(0,dims) that gets me an error of
hist(0,dimnames())
Error in dimnames() : 0 arguments passed to 'dimnames' which requires 1
I need to plot the height of the females and the height of the males. Is there a manual that I could read that would help me? I feel like I am just guessing at this point. The files are called fdims and mdims
Thanks
Tracy

Please take a look at these links and update your question.

your data is called bdims not dims...
also its not clear what the 0 is intending to achieve ?

I generally prefer ggplot2 to base plotting.
like:

library(tidyverse)

(info_of_interest <- select(bdims,
                           hgt,sex))

ggplot(data=info_of_interest) +
  aes(x=hgt,color=sex,fill=sex) +
  geom_histogram(bins = 25)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.