# cannot draw a histogram on R

#### polly123

##### New Member
Im trying to draw a histogram with the code below.

x = (2000:2013)
y = (0:12000)
hist(stat$Year,stat$Cases, ylab="Cases",xlab="Year",main="Number of cases of Lung Cancer:2000-2013")

error message:

> hist(ylab="Cases",xlab="Year",main="Number of cases of Lung Cancer:2000-2013")
Error in hist.default(ylab = "Cases", xlab = "Year", main = "Number of cases of Lung Cancer:2000-2013") :
argument "x" is missing, with no default
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'C://Heramba//Desktop//lung cancer.csv': No such file or directory

#### hlsmith

##### Omega Contributor
I don't use R a bunch, but can you run this line by line to better figure out where the error(s) is.

And maybe do some basics like just run the following:
summary(stat)
x
y

P.S., is the double slashes a thing? "//"

#### rogojel

##### TS Contributor
hi,
why do you have 2 parameters for the hist call? It only needs one. My guess is that you want a barchart of the number of cases per year. Something like:

Years=as.character(D$Years) barplot(D$Counts, names.arg=Years)

regards