R/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
#' @export
#'
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/tempRepo documentation built on April 8, 2019, 10:22 p.m.