html_3dPlot.Rd
This function generates an interactive 3d scatter plot. Includes a color changer and multi-panel wrapping.
html_3dPlot(
coordinates = NULL,
color = NULL,
discrete_colors_default = readRDS(system.file("data/jmp_discrete_colors.rds", package =
"magicBatch")),
discrete_colors_custom = NULL,
continuous_color_scale = viridis::viridis(100, option = "inferno"),
convert_integer_to_string = TRUE,
texts = NULL,
arrows = NULL,
rad = "auto",
wrap = NULL,
include_all_var = TRUE,
save_widget = TRUE,
capture_2D = FALSE,
out_dir = getwd(),
file_name = "plot",
selfcontained = FALSE
)
A m x 3 matrix of numeric xyz coordinates.
A m x n data.frame of data to plot as color. Categorical data (factors and character vectors) will be mapped to a discrete color scheme. Numerical data will be mapped to a continuous color scale.
A character vector of hexidecimal color codes to use as discrete colors. Default: readRDS(system.file("data/jmp_discrete_colors.rds", package = "magicBatch")).
Optional. A custom set of discrete color schemes specified as a named list of named vectors of hexidecimal color codes. Only list elements whose name matches a column name of color will be used. The names attribute of each list element must correspond to each unique element within the matched color column. Default: NULL.
A character vector of hexidecimal color codes to use as a continuous color scale. Defalut: NULL.
Whether to convert integer columns of color to character. Default: TRUE
Optional. A string corresponding to a column name of color containing a categorical variable. If specified,
Optional. A p x q data.frame containing arrow coordinates. The base of the arrows must be specified as xyz coodinates in columns 1:3. The tip of the arrows must be provided as xyz coordinates in column 4:6. Two additional optional columns can be included: one called "color" containing hexidecimal color codes for each arrow and one with the same name as wrap containing categorical data.
If arrows is not NULL, rad determines the radius of the arrow base. If set to 'auto' (default), arrow radius will be determined automatically.
Optional. A string corresponding to a column name of color (and optionally a column name of arrows) containing a categorical variable.
Whether to include an extra panel with all data points. Ignored if wrap is NULL.
Whether to save a html widget. Default: TRUE.
Whether to capture a 2D orthogonal projection of the current 3d view. Default: FALSE.
A character string specifying the directory where the plot should be saved. Default: current working directory.
A character string specifying the file name basename. The ".html" file extension will be appended to file_name automatically.
Whether to save the plot as a self contained html file. See htmlwidgets::saveWidget. Default: FALSE.
html_3dPlot is called for the side effect of saving a html file. If capture_2D is TRUE, a matrix
containing a 2D orthogonal projection of the current view of the data is invisibly returned.