I am trying to create an interactive map of Europe using irregular gridded orography data (Irregular grid means that lon-lat are not constant throughout each line-column of the matrix). So I thought I can use the heatmap function 3 times. The first 2 will display as hoverinfo the actual lat and lon of each grid, and the 3rd layer will be the orography.
I am recreating below a simple example. The first 2 layers of heatmap are working flawlessly, but when I add the last line I receive the error display below.
Adam, thank you for the reply. I am aware of vector and data.frame structures in R. x,y,z are data.frames (well basically matrix which is kinda the same) of the same dimensions (in my example 10*10). The problem is that plotly (for some reason) limits the “overploting” of heatmap function 2 times.
Basically if I do the following it works fine, and displays as hoverinfo the values of lon and lat objects:
plot_ly(z=t(lon), type = “heatmap”, hoverinfo=c(“z”)) %>%
add_trace(z=t(lat), hoverinfo=c(“z”))
The problem is that on top of that I want to display orog. which is a 1010 data.frame too. I can understand the error, any ideas why it says I provide a vector (while clearly I provide a 1010 data.frame) in the 3rd heatmap while it works fine when overploting the 2nd heatmap?