Create an interactive level plot (heatmap)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Create an interactive level plot (heatmap)



I have some test data that looks like this:


library(rbokeh)
library(lattice)

Date<-as.Date(c("2017-01-01","2017-01-01","2017-01-01","2017-01-02","2017-01-02","2017-01-02","2017-01-03","2017-01-03","2017-01-03","2017-01-4","2017-01-4","2017-01-4"))
Date<-as.POSIXct(Date)
Y<-c(1,2,3,1,2,3,1,2,3,1,2,3)
Temp<-c(20,23,25,19,20,21,18,19,20,13,17,19)
DF<-data.frame(Date,Y,Temp)



I visualize it using lattice levelplot like this:


dev.new(width=15, height=6)
levelplot(Temp ~ Date * Y, data = DF,ylim=c(3,1),
xlab = "TimeStamp", ylab = "Temp",
main = "Test", aspect=0.4,
col.regions =colorRampPalette(c('blue','red')),at=seq(13, 25, length.out=120))



I have started using rbokeh to create interactive plots in order to zoom in on various aspects of the x (date) axis for basic data exploration. But I cant find a way to create a similar kind of rbokeh-ish plot for this kind of levelplot. Is there a way to have rbokeh create a levelplot, or if not someother library that can?





Have you looked at plotly?
– Michael Bird
Aug 10 at 15:01





Plotly does have some very useful plotting functions. Thanks for the tip
– Vint
Aug 13 at 15:51




1 Answer
1


devtools::install_github("JohnCoene/echarts4r")

library(echarts4r)

DF %>%
dplyr::mutate(Date = as.Date(Date)) %>%
e_charts(Date) %>%
e_heatmap(Y, Temp) %>%
e_visual_map(Temp)





While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value.
– Nic3500
Aug 12 at 1:24






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard