随笔分类 - Rscript
摘要:用到R语言自带的mtcars数据集,首先我们把它转化成tibble形式,然后存放在mtcars1中。准备代码如下: library(tidyverse) mtcars %>% as_tibble() -> mtcars mtcars %>% group_by(cyl) %>% slice(1:3)
阅读全文
摘要:R中的apply族函数和多线程计算 龙君蛋君 2020-07-23 栏目: windows · 来源: 龙君蛋君 作者:龙君蛋君 简介 这篇文章主要介绍了R中的apply族函数和多线程计算以及相关的经验技巧,文章约6601字,浏览量234,点赞数4,值得参考! 一.apply族函数 1.apply
阅读全文
摘要:All packages need to be reinstalled under the new version (4.0). I had to first remove and then reinstall all the packages. The following worked for m
阅读全文
摘要:庐州月光 R语言绘图边框的单位 在R语言中指定画图边框时,通常使用两种单位, lines 和 inches 当然,这两个单位之间是可以相互转换的,那么 1 inch = ? line 答案是1 inches = 5 lines 下面给出具体的分析过程: par 函数中有两个参数,返回的是margin
阅读全文
摘要:R 绘图legend前面不要加+, plot()+legend是错误的.
阅读全文
摘要:pheno_data$group = factor(pheno_data$group,level=unique(pheno_data$group)) expr_data = expr_data[, as.character(rownames(pheno_data))] color = colorRa
阅读全文
摘要:> library("tidyr") Error in value[[3L]](cond) : Package ‘tidyr’ version 1.0.2 cannot be unloaded: Error in unloadNamespace(package) : namespace ‘tidyr
阅读全文
摘要:ggplot2点图+线性趋势+公式+R2+p值原创weixin_43948357 最后发布于2020-04-06 00:28:58 阅读数 13 收藏展开正文先看效果。 R语言代码如下, data("faithful")library(ggplot2)p <- ggplot(faithful,aes
阅读全文
摘要:R语言里重要的三个函数我认为就是 apply, melt, dcast 掌握了才能入门R . m = data.frame(m = c(1,2,3,4,5,6),n=c(3,4,5,7,8,9),t=c(4,5,6,7,8,9)) h = function(x,c1,c2){ v1 = median
阅读全文
摘要:If you have the file locally, then use install.packages() and set the repos=NULL: install.packages(path_to_file, repos = NULL, type="source") R CMD IN
阅读全文
摘要:R实战之热点图(HeatMap) 快速实现是搜索帮助文档的首要目的,所以此处涉及实战的文章一概略去传统帮助文档的理论部分,直接上代码加注释! 本文将介绍R语言下利用ggplot2包制作heatmap的代码 我是分割线 测试数据: 数据中的空白行、列用以分割heatmap,区别不同的数据处理,如不需要
阅读全文
摘要:R Multiple Plots In this article, you will learn to use par() function to put multiple graphs in a single plot by passing graphical parameters mfrow a
阅读全文
摘要:4 4 4 1) Put summary(coxphobject) into a variable summcph <- summary(coxphobject) 2) examine it with str() str(summcph) Values! Values everywhere! so
阅读全文
摘要:I am calculating cox propotional hazards models with the coxph function from the survival package. My data relates to failure of various types of endo
阅读全文
摘要:Jul 10, 2009; 10:46pm predict.glm -> which class does it predict? 2 posts Hi, I have a question about logistic regression in R. Suppose I have a small
阅读全文
摘要:http://www.sthda.com/english/wiki/ggplot2-texts-add-text-annotations-to-a-graph-in-r-software Install required packages Create some data Text annotati
阅读全文
摘要:Create a new ggplot Description ggplot() initializes a ggplot object. It can be used to declare the input data frame for a graphic and to specify the
阅读全文
摘要:If you'd like to simply test out the effect of that change in an interactive R session, you can do so using trace(). Here's how:
阅读全文
摘要:#!/usr/bin/Rscriptlibrary(ggplot2) cf = read.table(file = 'result_sort.txt', header = TRUE, sep='\t')cf$col = factor(cf$col, levels = c( "siginificant
阅读全文
摘要:如何利用R包qqman画曼哈顿图? 2017-07-10 lili 生信人 众多周知,R语言提供了各种各样的包,方便实现我们的目的,下面给大家介绍一个可以便捷的画曼哈顿图的包:qqman install.packages(“qqman”) # 安装包 library(“qqman”) #加载包 da
阅读全文