雅安工程交易建设网站,吉林省建设工程安管人员管理系统,wordpress自定义简码,域名生成器大家好#xff0c;今天我们分享一个神奇的网站#xff0c;提供各种可视化图片的代码和详解#xff0c;生信小博士公众号内回复冒号后面的关键词领取网站地址#xff1a;神奇网站
1.一R代码添加显著性 1#1----set.seed(123)library(ggplot2)library(ggstatsplot)ggbetweens…大家好今天我们分享一个神奇的网站提供各种可视化图片的代码和详解生信小博士公众号内回复冒号后面的关键词领取网站地址神奇网站
1.一R代码添加显著性 1#1----set.seed(123)library(ggplot2)library(ggstatsplot)ggbetweenstats( data iris, x Species, y Sepal.Length, title Distribution of sepal length across Iris species)还有详细参数的解释 2.还可以换一种方式展示 2#2------library(ggpubr)# Load datadata(ToothGrowth)df - ToothGrowthhead(df, 4)# Add p-values comparing groups# Specify the comparisons you wantmy_comparisons - list( c(0.5, 1), c(1, 2), c(0.5, 2) )ggboxplot(df, x dose, y len, color dose, palette c(#00AFBB, #E7B800, #FC4E07), add jitter, shape dose) stat_compare_means(comparisons my_comparisons) # Add pairwise comparisons p-value stat_compare_means(label.y 50) # Add global p-value# Violin plots with box plots inside# :::::::::::::::::::::::::::::::::::::::::::::::::::# Change fill color by groups: dose# add boxplot with white fill colorggviolin(df, x dose, y len, fill dose, palette c(#00AFBB, #E7B800, #FC4E07), add boxplot, add.params list(fill white)) stat_compare_means(comparisons my_comparisons, label p.signif) # Add significance levels stat_compare_means(label.y 50) # Add global the p-value3. 单细胞的密度图 3# 3 单细胞密度图----pbmcreadRDS(~/gzh/pbmc3k_final.rds)library(Seurat)
pDimPlot(pbmc,label TRUE)datp$datahead(dat)#install.packages(ggpointdensity)library(ggpointdensity)
ggplot(data dat, mapping aes(x UMAP_1, y UMAP_2)) geom_pointdensity(adjust 4) viridis:: scale_color_viridis() 4 生存曲线 4 #4 生存曲线------#install.packages(ggsurvfit)library(ggsurvfit)# Loading required package: ggplot2
p - survfit2(Surv(time, status) ~ surg, data df_colon) | ggsurvfit(linewidth 1) add_confidence_interval() add_risktable() add_quantile(y_value 0.6, color gray50, linewidth 0.75) scale_ggsurvfit()pp # limit plot to show 8 years and less coord_cartesian(xlim c(0, 8)) # update figure labels/titles labs( y Percentage Survival, title Recurrence by Time From Surgery to Randomization, )