Very new to R programming and trying to create a bar plot, however my categorical x variable remains grouped together and I get a single bar without any usable information. A subsample is as follows:
New Name Tot Pl L Ld P Min
1: 1 376.62 5.91
2: 4 689.07 7.26
3: 5 202.14 4.67
4: 6 516.28 6.01
5: 7 698.02 7.41
6: 8 180.50 3.69
7: 9 163.12 4.24
8: 10 176.66 4.59
9: 11 665.34 7.97
10: 2 584.28 6.18
11: 3 155.67 4.04
12: 1 137.28 3.65
13: 4 181.87 4.84
14: 5 152.95 4.07
15: 6 150.07 3.99
16: 7 156.41 4.16
17: 8 108.19 2.88
18: 9 162.76 4.33
19: 10 175.88 4.68
20: 11 160.88 4.28
21: 2 148.53 3.95
22: 3 155.28 4.13
23: 1 62.84 10.49
24: 4 145.73 10.85
25: 5 12.00 8.08
26: 6 68.25 8.92
27: 7 143.88 11.83
28: 8 0.12 0.56
29: 9 0.22 1.04
30: 10 0.39 1.80
31: 11 162.22 12.08
32: 2 115.77 8.62
33: 3 0.11 0.51
The code I am using is
ggplot(ngames, aes(x= 'New Name', y= 'Ld P Min')) + geom_bar(stat = "summary")
which gives me this incorrect graph
I have been able to create an example graph of what I'm looking for using stock data from iris, but it doesn't seem to work with my data despite all of data formats being identical to those in iris. example of expected graph. The code for this graph is
ggplot(iris, aes(x = Species, y = Sepal.Length)) +
geom_bar(stat = "identity")
Thanks for the help.