I have following data in a file called binFile
78 1
79 4
80 33
81 150
82 714
83 2663
84 8834
85 25679
86 63654
87 139731
88 265909
89 441686
90 639773
91 803736
92 879616
93 832181
94 682584
95 480228
96 290093
97 149299
98 65443
99 24487
100 7487
101 1835
102 402
103 59
104 10
How do I create a simple bar graph from this data where the first column is along the x-axis and the height of the bar should be proportional to the corresponding value in second column.
Till now, I have tried the following:
binData <- read.table("binFile")
costBars = ggplot(binData,aes(x=V1,y=V2))
finalPlot2 = costBars + geom_bar()
finalPlot2
However these commands generate the following error?
stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.
Error in pmin(y, 0) : object 'y' not found
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…