-1

(1) i have a frequncy table called resdf that looks like this- here is the table

(2)this is the line of code i tried using awards_given<-hist(resdf$Year,resdf$Freq,type="h",breaks=seq(0,88,by=10))

(3) i get this error

Error in hist.default(resdf$Year, resdf$Freq, type = "h", breaks = seq(0,  : 
  some 'x' not counted; maybe 'breaks' do not span range of 'x'
user438383
  • 5,716
  • 8
  • 28
  • 43
CODERjack
  • 11
  • 2

1 Answers1

0

Histogram only takes a vector as input. You had put two in. I guess this is what you want:

hist(resdf$Freq)
AlpacaKing
  • 371
  • 2
  • 10
  • hi. i ran this line but it says now x must be numeric all coloumns are numeric in this df any other suggestions for this problem? – CODERjack Aug 10 '22 at 18:06
  • hi. i ran this line but it says now x must be numeric all coloumns are numeric in this df any other suggestions for this problem? – CODERjack Aug 10 '22 at 18:06
  • @CODERjack https://stackoverflow.com/questions/2349205/cant-draw-histogram-x-must-be-numeric – user438383 Aug 10 '22 at 18:20
  • Maybe your "Freq" column is not numeric? I have no idea on your data... btw, you can try to coerce the variable to numeric : hist(as.numeric(resdf$Freq)) – AlpacaKing Aug 11 '22 at 11:08