## Not run:
#
# # mtcars
# # x <- heatmapr(mtcars)
# library(heatmaply)
# heatmaply(iris[,-5], k_row = 3, k_col = 2)
# heatmaply(cor(iris[,-5]))
# heatmaply(cor(iris[,-5]), limits = c(-1,1))
# heatmaply(mtcars, k_row = 3, k_col = 2)
#
# # make sure there is enough room for the labels:
# heatmaply(mtcars, margins = c(40, 130))
# # this is the same as using:
# heatmaply(mtcars) %>% layout(margin = list(l = 130, b = 40))
#
# # control text angle
# heatmaply(mtcars, column_text_angle = 90, margins = c(40, 130))
# # the same as using srtCol:
# # heatmaply(mtcars, srtCol = 90) %>% layout(margin = list(l = 130, b = 40))
#
#
#
# x <- mtcars
# # different colors
# heatmaply(x, colors = heat.colors(200))
# # using special scale_fill_gradient_fun colors
# heatmaply(x, scale_fill_gradient_fun = scale_color_gradient())
#
#
# # We can join two heatmaps together:
# library(heatmaply)
# hm1 <- heatmaply(mtcars, margins = c(40, 130))
# hm2 <- heatmaply(mtcars, scale = "col", margins = c(40, 130))
# subplot(hm1, hm2, margin = .2)
#
# # If we want to share the Y axis, then it is risky to keep any of the dendrograms:
# library(heatmaply)
# hm1 <- heatmaply(mtcars, Colv = FALSE, Rowv = FALSE, margins = c(40, 130))
# hm2 <- heatmaply(mtcars, scale = "col" , Colv = FALSE, Rowv = FALSE,
# margins = c(40, 130))
# subplot(hm1, hm2, margin = .02, shareY = TRUE)
#
# # We can save heatmaply as a widget by using:
# library(heatmaply)
# library(htmlwidgets)
# heatmaply(iris[,-5]) %>%
# saveWidget(file="test.html",selfcontained = FALSE)
#
#
# # Example for using RowSideColors
#
# x <- as.matrix(datasets::mtcars)
# rc <- colorspace::rainbow_hcl(nrow(x))
#
# library(gplots)
# library(viridis)
# heatmap.2(x, trace = "none", col = viridis(100),
# RowSideColors=rc)
#
# heatmaply(x, seriate = "mean",
# RowSideColors=rc)
#
#
# heatmaply(x[,-c(8,9)], seriate = "mean",
# col_side_colors = c(rep(0,5), rep(1,4)),
# row_side_colors = x[,8:9])
# heatmaply(x[,-c(8,9)], seriate = "mean",
# col_side_colors = data.frame(a=c(rep(0,5), rep(1,4))),
# row_side_colors = x[,8:9])
#
#
#
# ## End(Not run)
Run the code above in your browser using DataLab