0

Thanks for taking the time to answer this question. I am sadly not a coder I have a column of data that has the seconds passed since a runner has started running. I also have a column which records the audio of how loud a crowd cheered( the audio is integer values). I'm trying to show as the runner got closer to the finish line the crowd gets louder graphically.

Is there anyway to graph the time column as the x-axis while simultaneously plotting the crowds reaction on the graph itself.

After searching the forums most questions deal with time series, but I do not believe this is a time series question more like a graphing question.

One column is called time and it starts at 0 with frequency 5 milliseconds, volume is another column that has integers 0-5 with 0 being silence and 5 being the loudest

  • 1
    Welcome @TheCenterWillNotHold. Please provide sample data. See https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for the best way to post a question. – Andrew Lavers Apr 02 '18 at 02:30
  • Apologies epi99 first time question poster how do I upload the data? – TheCenterWillNotHold Apr 02 '18 at 02:31
  • Only provide a small reproducible sample of data - not the full dat set. Using `dput` is recommended because that can be precisely reproduced. Another approach (as in answer below) is just to initialize the data frame with sample values – Andrew Lavers Apr 02 '18 at 02:55
  • 1
    Thank you so much for the advice epi99, I will remember it going forward. – TheCenterWillNotHold Apr 02 '18 at 03:05

1 Answers1

0

Here is a guess at your data structure

library(ggplot2)                                                         
df <- data.frame(elapsed_milliseconds = c(60000, 120000, 180000, 240000),
volume = c(1,1.5,2,3)) 

print(df)                                                                
#>   elapsed_milliseconds volume
#> 1                60000    1.0
#> 2               120000    1.5
#> 3               180000    2.0
#> 4               240000    3.0

ggplot(df, aes(x = elapsed_milliseconds, y = volume)) +                  
  geom_line()  

enter image description here

Andrew Lavers
  • 4,328
  • 1
  • 12
  • 19