随笔分类 - R语言
摘要:001、R 语言中出现如下报错 > a <- 1:5 > b <- letters[1:5] > test <- data.frame(a, b) > library(dplyr) > select(test, a) Error in (function (classes, fdef, mtable
阅读全文
摘要:R 语言中双中括号 [[]]与数据类型列表的关系。 for (row in 1:nrow(gterms)) { gene_terms <- str_split(gterms[row,"GOs"], ",", simplify = FALSE)[[1]] gene_id <- gterms[row,
阅读全文
摘要:R语言中管道符号 %>% 的应用及举例 gterms <- egg %>% dplyr::select(query, GOs) %>% na.omit() gene2go <- data.frame(term = character(), gene = character())
阅读全文
摘要:R语言中na.omit函数的应用 以及 在数据框中的应用 gterms <- egg %>% dplyr::select(query, GOs) %>% na.omit() gene2go <- data.frame(term = character(), gene = character()) 示
阅读全文
摘要:001 96,GO:0051093,GO:0051094,GO:0051171,GO:0051172,GO:0051173,GO:0051239,GO:0051240,GO:0051241,GO:0051246,GO:0051247,GO:0051248,GO:0051252,GO:0051254,
阅读全文
摘要:001、基础绘图 plot(1:10) legend('topleft', ## legend函数默认会带有一个框线 c("Presence", "Absence"), col= "royalblue1", pch = 15, cex = 1, text.font = 2, inset= 0.02)
阅读全文
摘要:001、基础绘图 library(ggplot2)#导入ggplot包 ggplot(data = mtcars, aes(x = wt, y = mpg, colour = factor(cyl))) + geom_point() + theme_bw() ## 基础绘图 002、设置y轴刻度标签
阅读全文
摘要:001、基础绘图 library(ggplot2)#导入ggplot包 ggplot(data = mtcars, aes(x = wt, y = mpg, colour = factor(cyl))) + geom_point() + theme_bw() ## 基础绘图 002、设置x轴名称与框
阅读全文
摘要:001、基础绘图 library(ggplot2)#导入ggplot包 ggplot(data = mtcars, aes(x = wt, y = mpg, colour = factor(cyl))) + geom_point() + theme_bw() ## 基础绘图 002、调整x轴上刻度文
阅读全文
摘要:001、基础绘图 library(ggplot2) ## 加载包 ggplot(data = mtcars, aes(x = wt, y = mpg, colour = factor(cyl))) + geom_point() ## 绘制散点图 002、增加四边框线 library(ggplot2)
阅读全文
摘要:001、基础绘图 library(ggplot2)#导入ggplot包 ggplot(data = mtcars, aes(x = wt, y = mpg, colour = factor(cyl))) + geom_point() + theme_bw() 002、设置刻度标签的粗细 librar
阅读全文
摘要:001、简单用法 > a <- c(1,2, 7, 8) ## 定义向量a > b <- c(2, 3, 7, 9) ## 定义向量b > a %in% b ## 判断向量a中元素是否在向量b中,返回逻辑向量 [1] FALSE TRUE TRUE FALSE 002、取两个向量的交集 > a <-
阅读全文
摘要:001、print函数 a、简单输出 > print(100) ## 输出数值 [1] 100 > print("abcd") ## 输出字符串 [1] "abcd" b、输出变量 > a <- 100 > b <- "xyz" > print(a) ## 输出数值变量 [1] 100 > prin
阅读全文
摘要:001、测试数据及绘图 x <- c("B","A","D","C","E") ## 测试数据顺序 y <- c(5,6,7,8,9) df <- data.frame(x = x , y = y) df library("ggplot2") ggplot(data=df,aes(x=x,y=y))
阅读全文
摘要:001、基础绘图 library(ggplot2) p <- ggplot(faithful, aes(x = eruptions, y = waiting)) + geom_point() p 02、清空x轴title p + theme(axis.title.x =element_blank()
阅读全文
摘要:001、基础绘图 library(ggplot2) p <- ggplot(faithful, aes(x = eruptions, y = waiting)) + geom_point() p ## 基础绘图 02、调整刻度线标签的长度 p + theme(axis.ticks.length =
阅读全文
摘要:001、问题如下:R语言控制台一直出现 + 号该怎么处理 002、解决方法 按 ESC键。
阅读全文
摘要:001、基础绘图 library(ggplot2) p <- ggplot(faithful, aes(x = eruptions, y = waiting)) + geom_point() p ## 基础绘图 002、调整轴标签与绘图区域的间距 a、 p + theme(axis.text.x=e
阅读全文
摘要:001、问题,安装 devtools中遇到如下报错:Configuration failed to find one of freetype2 libpng libtiff-4 libjpeg. 002、解决方法: [root@pc1 ~]# yum install freetype-devel l
阅读全文

浙公网安备 33010602011771号