首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏大数据文摘

    一行R代码实现繁琐的可视化

    输入help(autoplot.prcomp) 可以了解到更多的其他选择。 更多的选择请参考 help(autoplot.ts)。 autoplot(Canada, facets = FALSE) autoplot 也可以理解其他的时间序列类别。 ) autoplot(smoothed) p <- autoplot(filtered) autoplot(smoothed, ts.colour = 'blue', p = p) KFAS包 library , states="trend") p <- autoplot(filtered) autoplot(trend, ts.colour = 'blue', p = p) stats包 可支持的stats

    1.3K110发布于 2018-05-22
  • 来自专栏PPV课数据科学社区

    一行R代码来实现繁琐的可视化

    输入help(autoplot.prcomp) 可以了解到更多的其他选择。 autoplot(prcomp(df), data = iris, colour = 'Species') ? 更多的选择请参考help(autoplot.ts)。 autoplot(AirPassengers, ts.colour = 'red', ts.linetype = 'dashed') ? autoplot(Canada, facets = FALSE) ? autoplot 也可以理解其他的时间序列类别。 p <- autoplot(filtered) autoplot(smoothed, ts.colour = 'blue', p = p) ? trend <- signal(smoothed, states="trend") p <- autoplot(filtered) autoplot(trend, ts.colour = 'blue',

    2.1K61发布于 2018-04-23
  • 来自专栏作图丫

    主成分分析和时序分析神器

    R包的使用 01 时序分析可视化 使用AirPassengers数据集绘制基本时序分析图片 #AirPassengers数据集 autoplot(AirPassengers) 使用 ts.colour 和ts.linetype改变线的颜色和形状 autoplot(AirPassengers, ts.colour = 'red', ts.linetype = 'dashed',xlab = "time ::install("strucchange") library(strucchange) autoplot(breakpoints(Nile ~ 1)) 多变量的时序分析: BiocManager ,只画后3列 autoplot(Canada[,-1])#fig.2 #使用 facets = FALSE 可以把所有变量画在一条轴上。 [, -5] # 主成分分析 pca <- prcomp(df, scale. = TRUE) # 绘图 autoplot(pca, loadings = TRUE, loadings.label =

    89510编辑于 2022-03-29
  • 来自专栏小明的数据分析笔记本

    R语言可视化展示gff3格式基因组注释文件简单小例子

    library(GenomicFeatures) txdb<-makeTxDbFromGFF(file="practice.gff",format="gff3") 可视化 用到的 ggbio 这个包中的 **autoplot ()**这个函数 library(ggbio) autoplot(txdb, which=GRanges("CP002684.1", IRanges(100, 9000)), 可以通过fill参数设置不同的颜色 autoplot(txdb, which=GRanges("CP002684.1", IRanges(100, 9000)), names.expr image.png 不同的基因填充不同的颜色 autoplot(txdb, which=GRanges("CP002684.1", IRanges(100, 9000)), 今天就到这里了,抽时间看看下autoplot()这个函数的帮助文档

    3.7K41发布于 2020-07-10
  • 来自专栏作图丫

    ggcyto--实现R语言的流式细胞数据可视化!

    "purple") 2、ggcyto ggcyto(gs, aes(x = CD4, y = CD8)) + geom_hex(bins = 128) + geom_gate("CD8") 3、autoplot autoplot(fs, "CD4") autoplot(fs, "CD4", "CD8", bins = 64) autoplot(gs, c("CD4", "CD8"), bins = 64) in-line transformation 它是由专门为细胞计数设计的不同scales layers完成的 #先绘制原始的scale data(GvHD) fr <- GvHD[[1]] p <- autoplot ggCyto还提供了拼图设置布局的功能 gh <- gs[[1]] nodes <- gs_get_pop_paths(gh, path = "auto")[c(3:9, 14)] nodes p <- autoplot (gh, nodes, bins = 64) class(p) p gt <- ggcyto_arrange(p, nrow = 1) class(gt) p2 <- autoplot(gh_pop_get_data

    2K31编辑于 2022-03-29
  • 来自专栏R语言交流中心

    R语言实现流式细胞数据分析

    library(ggcyto) autoplot(X, "FL1-H","FL2-H") ? exprs(fs[[1]][1:12,])##获取数据 autoplot(fs, "FL1-H","FL2-H") ? compensate(fs, comp) library(gridExtra) transList <- estimateLogicle(x,c("V450-A","V545-A")) p1 <- autoplot (transform(x, transList),"V450-A", "V545-A") +ggtitle("Before") p2 <- autoplot(transform(x_comp,transList autoplot(gs[[1]])#可视化所有的门 ? 当然还可以更加细化门的分类,以及门的构成,在此我们就不再深究了。

    6.3K31发布于 2020-02-11
  • 来自专栏生物信息与临床医学专栏

    R语言机器学习之Task对象可视化(mlr3包系列)

    "pregnant" #[7] "pressure" "triceps" task$select(head(task$feature_names, 3)) # 选取前三列特征变量(features) autoplot (task) # 绘图,这里只会针对目标变量来绘图 autoplot(task, type = "pairs") # 绘制配对的关联图 在上图中,红色代表的是糖尿病组,蓝色代表的是非糖尿病组。 autoplot(task, type = "duo") # 绘制duo图 上面这幅图很好地展现出糖尿病和非糖尿病人群中三个特征变量的差异,直观简洁!

    66020编辑于 2022-08-21
  • 来自专栏火星娃统计

    mlr3_训练和测试

    classif.rpart", predict_type = "prob") learner$train(task) prediction = learner$predict(task) # 绘制默认图 autoplot (prediction) # 绘制roc图 autoplot(prediction, type = "roc") ? task = tsk("mtcars") learner = lrn("regr.lm") learner$train(task) prediction = learner$predict(task) autoplot

    1.1K10发布于 2021-02-05
  • 来自专栏优雅R

    「R」ggplot2在R包开发中的使用

    因为这个原因,ggplot2定义了一个自己的泛型函数autoplot(),调用它会返回一个ggplot()。 #' @importFrom ggplot2 autoplot autoplot.discrete_distr <- function(object, ...) { plot_data <- discrete_distr_data probability)) + geom_col() + coord_flip() + labs(x = "Value", y = "Probability") } 一旦定义了 autoplot (x, ...)) } 如果你不懂S3类,实现像plot()或者autoplot()这种泛型是一个不好的实践,因为这限制了包开发者自己控制S3用于实现自己的方法。 %+replace% ggplot2::theme(panel.background = ggplot2::element_blank()) } 通过,如果你为ggplot2的autoplot

    11.6K30编辑于 2022-03-30
  • 来自专栏火星娃统计

    mlr3_建立task

    使用mlr3viz包,绘制任务图 返回的是数据的相关图、分布图 library("mlr3viz") autoplot(task_mtcars, type = "pairs") ## Registered 建立任务,使用的为预置任务集 task = tsk("pima") # 只选择前三个列名,也就是特征 task$select(head(task$feature_names, 3)) # 默认绘制频率图 autoplot # 绘制配对的图 # 显示的信息较多 autoplot(task, type = "pairs") ? 同时对于回归任务也是一样的,这里就不粘贴绘制的图片了 library("mlr3viz") task = tsk("mtcars") task$select(head(task$feature_names, 3)) autoplot (task) autoplot(task, type = "pairs") 结束语 mlr3关于任务的建立更新完毕 love&peace

    84940发布于 2021-01-19
  • 来自专栏医学和生信笔记

    mlr3的校准曲线也是一样画!

    ## truth ## response pass run ## pass 31932 9886 ## run 8819 18345 混淆矩阵可视化: autoplot classif.auc classif.acc classif.bbrier ## 0.7979179 0.7288424 0.1790592 喜闻乐见ROC曲线: autoplot (rr,type = "roc") plot of chunk unnamed-chunk-9 喜闻乐见的prc曲线: autoplot(rr, type = "prc") plot of chunk unnamed-chunk-10 箱线图: autoplot(rr, measure = msr("classif.auc")) plot of chunk unnamed-chunk-11 以上所有介绍的图形和评价方法都在之前的推文详细介绍过了

    1K30编辑于 2022-11-15
  • 来自专栏生信技能树

    PCA-弱水三千,取哪一瓢饮?

    教程看群主之前的推文: 【直播】我的基因组55:简单的PCA分析千人基因组的人群分布 重复一篇Cell文献的PCA图 prcomp 用到的参数介绍 prcomp是R的stats 包(base级别)的函数; autoplot ggfortify中的函数,frame即对分出来的簇加上边界,frame.type即边界类型设定为norm; ######ggplot2太大了,得抽时间好好了解; library(ggfortify) autoplot (prcomp( df[,1:ncol(df)-1] ), data=df,colour = 'group') autoplot(prcomp( df[,1:ncol(df)-1] ),

    1.3K10发布于 2019-05-23
  • 来自专栏优雅R

    mlr3基础(二)

    可视化重采样结果 mlr3viz提供了一个autoplot()方法。 (rr, measure = msr("classif.auc")) img # ROC curve, averaged over 10 folds autoplot(rr, type = "roc ") img # learner predictions for first fold rr$filter(1) autoplot(rr, type = "prediction") img autoplot.ResampleResult 可视化重采样分区 Mlr3spatiotempcv提供autoplot()方法来可视化时空数据集的重采样分区。更多信息,请参阅函数参考[39]和vignette“时空可视化”[40]。 library("mlr3viz") # TPR vs FPR / Sensitivity vs (1 - Specificity) autoplot(pred, type = "roc") img

    3.3K10发布于 2021-09-24
  • 来自专栏医学和生信笔记

    使用mlr3搞定二分类资料的多个模型评价和比较

    4: kknn 0.7322762 0.6779451 0.2210171 结果可视化 支持ggplot2语法,使用起来和tidymodels差不多,也是对结果直接autoplot library(ggplot2) autoplot(bmr)+theme(axis.text.x = element_text(angle = 45)) 喜闻乐见的ROC曲线: autoplot(bmr prediction$confusion truth response pass run pass 10629 3175 run 2955 6235 可视化混淆矩阵: autoplot )) classif.auc classif.acc classif.bbrier 0.8011720 0.7334087 0.1775684 喜闻乐见ROC曲线: autoplot

    1.4K30编辑于 2022-11-15
  • 来自专栏医学和生信笔记

    tidymodels不能画校准曲线?

    10622 3226 ## run 2962 6185 混淆矩阵图形版: pred_rf %>% conf_mat(play_type,.pred_class) %>% autoplot binary 0.799 可视化结果,首先是大家喜闻乐见的ROC曲线: pred_rf %>% roc_curve(truth = play_type, .pred_pass) %>% autoplot ) plot of chunk unnamed-chunk-13 pr曲线: pred_rf %>% pr_curve(truth = play_type, .pred_pass) %>% autoplot of chunk unnamed-chunk-14 gain_curve: pred_rf %>% gain_curve(truth = play_type, .pred_pass) %>% autoplot of chunk unnamed-chunk-15 lift_curve: pred_rf %>% lift_curve(truth = play_type, .pred_pass) %>% autoplot

    1.1K50编辑于 2022-11-15
  • 来自专栏火星娃统计

    mlr3_重抽样

    51:60, 101:110)), test = list(c(11:20, 61:70, 111:120)) ) resampling$iters 绘制结果 library("mlr3viz") autoplot 绘制roc曲线 autoplot(rr, type = "roc") ? 结束语 对于重抽样的操作,建议在高性能的服务器上进行,或者测试数据较少或者特征较少的数据集。 love&peace

    1.2K20发布于 2021-02-05
  • 来自专栏生信情报站

    详解 R 语言的PCA与TSNE的降维聚类

    group=c(rep('group1',20),rep('group2',20))) # prcomp()主成分分析 pca_dat <- prcomp( df[,1:(ncol(df)-1)] ) autoplot sample_all); dim(sample_all) df=cbind(as.data.frame(a3),group=c(rep('group1',20),rep('group2',20))) autoplot group1',cell_num),rep('group2',cell_num))) # prcomp()主成分分析 pca_dat <- prcomp( df[,1:(ncol(df)-1)] ) autoplot as.data.frame(sample_all),group=c(rep('group1',cell_num),rep('group2',cell_num),rep('group3',cell_num))) autoplot

    1.9K20发布于 2021-04-23
  • 来自专栏生信技能树

    PCA-Statistics is the new sexy!!!

    对比下在R的现成的PCA功能的结果 FactoMineR和factoextra配合做PCA和可视化(下图中图片名为PCA); prcomp(stats base级别)和autoplot配合做PCA和可视化 为协方差矩阵; deca_re$x ###生成名为Rplot_deca$x的图,方便与ggfortify的作图对比 plot(deca_re$x) #####ggfortify使ggplot2功能更加丰富,使autoplot 能够处理prcomp的结果 library(ggfortify) autoplot(prcomp(decathlon2.active),label=TRUE,loadings=TRUE) ######

    99120发布于 2019-05-24
  • 来自专栏Listenlii的生物信息笔记

    ggplot: PCA~DCA~NMDS~PCoA~CCA

    geom_hline(aes(yintercept = 0), linetype="dashed") + geom_vline(aes(xintercept = 0) ,linetype="dashed") ####autoplot #autoplot是ggplot object ,可以在此基础上继续添加图层。 #C.whole是CCA的结果 >autoplot(C.whole) ?

    1.8K42发布于 2020-05-29
  • 来自专栏医学和生信笔记

    使用workflow一次完成多个模型的评价和比较

    four_fits %>% autoplot(metric = "roc_auc")+theme_bw() image-20220704145235120 选择最好的模型用于测试集 选择表现最好的应用于测试集 20220704145017664 可视化结果,喜闻乐见的混淆矩阵: collect_predictions(rand_res) %>% conf_mat(play_type,.pred_class) %>% autoplot 20220704145028522 喜闻乐见的ROC曲线: collect_predictions(rand_res) %>% roc_curve(play_type,.pred_pass) %>% autoplot

    2K50编辑于 2022-11-15
领券