0

I have a telematic insurance dataset with 1-sec sample for a driver that agreed to have installed in its vehicle an event data recorder. This is how data look like:

    head(y,15)
        ACCELERATION    GPS_SPEED
2071513        0.012            1
2071514        0.012            2
2071515        0.012            3
2071516        0.012            4
2071517        0.012            5
2071518        0.012            6
2071519        0.012            7
2071520        0.012            8
2071521        0.012            9
2071522        0.000           10
2071523       -0.012           16
2071524       -0.012           17
2071525        0.000           24
2071526        0.084           25
2071527        0.096           26

I would like to create a v-a heatmap as follow:

v-a heatmap

The code I tried to build and run, is hereby:

y <- as.data.frame(head(dplyr::select(data1, RT_AVG_ACC_X, RT_GPS_SPEED),5000))
y <- as.matrix(y)
heatmap(y)

The result is pretty awful: result of the above code

Would you guys please help me?
Thank you all.

Result of the code in the answer: Plot ggplot2

  • 1
    You might get more feedback if your title said "velocity-acceleration" instead of "v-a", which doesn't mean anything without context. Also, describing what is "pretty awful" and how you'd like to change the result would make your question much easier to answer. – Caleb Oct 31 '18 at 13:38
  • 1
    I am so sorry. I am new in this environment. So, yes "v-a"stands for velocity-acceleration. I want the result be pretty much the same as the image attached. My result is a not good heatmap with 4 squares and dendogram on the side. – Lars Trivellato Oct 31 '18 at 13:41
  • 1
    No worries — everybody starts somewhere. Just keep in mind that the only information readers have about your problem is what you put in your question. You can edit your question to add to it or clarify it. – Caleb Oct 31 '18 at 13:44
  • Welcome to SO! Please, add a [gRre](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to help to be helped: adding data and working code (till your issues) it's a good practice to get a nice answer. – s__ Oct 31 '18 at 13:44

0 Answers0