R/fct_plotly_3d_scatter.R

Defines functions plotly_3d_scatter

Documented in plotly_3d_scatter

#' Create 3d scatter plotly plot
#'
#' @param data data frame with data and colors and sample names
#' @param plotTitle plot title
#'
#' @return plotly plot
#' 
#'
plotly_3d_scatter <- function(data,
                              plotTitle){
  plotly::plot_ly(data = data,
                  x = ~Dim1,
                  y = ~Dim2,
                  z = ~Dim3,
                  type = "scatter3d",
                  mode = "markers",
                  marker = list(color = ~fac),
                  hoverinfo = 'text',
                  text = ~nam) %>% 
    plotly::layout(title = plotTitle)
}
chasemc/IDBac_App documentation built on Oct. 25, 2022, 7:34 a.m.