View source: R/jj_contour_lines.R
jj_get_contour_lines | R Documentation |
estimate densities to include density area in tsne/umap. May fail for small datasets
jj_get_contour_lines(reduction_df, grouping_var, cont_thres)
reduction_df |
number of columns |
grouping_var |
number of rows |
cont_thres |
value to put into every cell |
dr_df = data.frame(dim1 = c(rnorm(500, 3, 0.5), rnorm(200, 4, 0.1)),
dim2 = c(rnorm(500, 3, 0.5), rnorm(100, 4, 1), rnorm(100, 3.5, 1)),
group = rep(LETTERS[1:2], c(500,200)))
cont_l = jj_get_contour_lines(reduction_df = dr_df, grouping_var = 'group', cont_thres = 0.75)
gg = jj_plot_features(reduction = dr_df, meta_features = 'group', return_gg_object = T)
gg[[1]] + geom_path(data = cont_l,
aes(x=x, y=y, group=cont_group, linetype=group, colour=group),
size=1) +
labs(linetype='')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.