Home>

From the previous question, I was able to create a data frame, but I tried to create a bar graph frombarplot (x $speed). A statement is displayed.

  

Error in barplot.default (x $speed):
  'height' must be a vector or matrix

Data frame
x<-data.frame (TIME = c (1,2,3,4,5,6,7,8,9,10,11,12,13, 14,15,16,17), SPEED = c (2,5,2,5,3,3,3,3,2,3,2,4,3,3,3,3,3))

TIME SPEED
1 1 2
2 2 5
3 3 2
4 4 5
5 5 3
6 6 3
7 7 3
8 8 3
9 9 2
10 10 3
11 11 2
12 12 4
13 13 3
14 14 3
15 15 3
16 16 3
17 17 3


What is the cause of this error statement?
How do you make a bar chart?

r