随笔分类 -  R语言

上一页 1 2 3 4 5 6 ··· 26 下一页
摘要:001、正常绘图 plot(1:10, cex = 2, pch = 19) 002、不输出x轴刻度标签 plot(1:10, cex = 2, pch = 19, xaxt = "n") 。 reference 01、https://www.cnblogs.com/shclbear/p/17253 阅读全文
posted @ 2024-05-17 23:05 小鲨鱼2018 阅读(91) 评论(0) 推荐(0) 编辑
摘要:001、正常绘图 > plot(1:10, cex = 2, pch = 19) 002、只输出绘图内容 > plot(1:10, cex = 2, pch = 19, axes = F) 。 reference 01、https://www.cnblogs.com/shclbear/p/17253 阅读全文
posted @ 2024-05-17 22:58 小鲨鱼2018 阅读(45) 评论(0) 推荐(0) 编辑
摘要:001、不为整数 > a <- 5.324 > floor(a) == a ## 截断后不相等, 说明带有小数点部分,即不为整数 [1] FALSE 002、是整数 > b <- 324 > floor(b) == b ## 截断小数点后仍然相等,说明是整数 [1] TRUE 。 阅读全文
posted @ 2024-05-17 22:33 小鲨鱼2018 阅读(38) 评论(0) 推荐(0) 编辑
摘要:001、round,四舍五入 > a <- 5.345 ## 舍去 > round(a) [1] 5 > b <- 5.824 ## 进位 > round(b) [1] 6 002、round,四舍五入指定小数位数 > a <- 8.426532 > round(a, 1) ## 保留一位小数,四舍 阅读全文
posted @ 2024-05-17 22:22 小鲨鱼2018 阅读(35) 评论(0) 推荐(0) 编辑
摘要:001、测试 a <- c("1.23e-2", "7.56207e-05", "6.86470e-05") as.numeric(a) ## 直接转换为数值类型, 然而并不起作用 02、增加参数(全局使用) options(scipen = 100) ## 小数点后100位不适用科学计数法 b < 阅读全文
posted @ 2024-05-13 11:37 小鲨鱼2018 阅读(865) 评论(0) 推荐(0) 编辑
摘要:需求: 一张图片,想知道到底是什么颜色, 在R语言中的颜色系统中。 测试图片如下: 001、 install.packages("colorfindr") ## 安装包 library("colorfindr") ## 加载包 get_colors( img = "aa.png", min_shar 阅读全文
posted @ 2024-04-29 15:07 小鲨鱼2018 阅读(65) 评论(0) 推荐(0) 编辑
摘要:001、 https://palettegenerator.com/ https://www.jianshu.com/p/52f0764179d9 阅读全文
posted @ 2024-04-29 12:05 小鲨鱼2018 阅读(19) 评论(0) 推荐(0) 编辑
摘要:001、 基础绘图 library(ggplot2) p <- ggplot(faithful, aes(x = eruptions, y = waiting)) + geom_point() p 002、调整标签刻度到绘图区域的间距 p + theme(axis.text.x = element_ 阅读全文
posted @ 2024-04-17 11:55 小鲨鱼2018 阅读(722) 评论(0) 推荐(0) 编辑
摘要:R语言中pch对照表: 。 阅读全文
posted @ 2024-04-10 20:49 小鲨鱼2018 阅读(186) 评论(0) 推荐(0) 编辑
摘要:001、 a <- sample(20:80,15) a b <- matrix(a,nrow=3) b par(mfrow = c(2, 1)) barplot(b,width=1,beside=T, space = c(0, 2), main = "xxx") barplot(b,width=1 阅读全文
posted @ 2024-04-10 20:32 小鲨鱼2018 阅读(73) 评论(0) 推荐(0) 编辑
摘要:软件包安装: 001、系统 [root@localhost test01]# cat /etc/redhat-release ## 系统 CentOS Linux release 8.4.2105 。 002、安装epel软件源 [root@localhost test01]# yum instal 阅读全文
posted @ 2024-04-04 21:56 小鲨鱼2018 阅读(305) 评论(0) 推荐(0) 编辑
摘要:前者:for (row in 1:nrow(gterms)) { gene_terms <- str_split(gterms[row,"GOs"], ",", simplify = FALSE)[[1]] gene_id <- gterms[row, "query"][[1]] tmp <- da 阅读全文
posted @ 2024-03-25 23:10 小鲨鱼2018 阅读(11) 评论(0) 推荐(0) 编辑
摘要:R语言中sappy、unlist函数的应用 gene_to_go <- data.frame(gene = rep(gene_ids[eggnog_lines_with_go], times = sapply(eggnog_annoations_go, length)), term = unlist 阅读全文
posted @ 2024-03-25 23:07 小鲨鱼2018 阅读(17) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2024-03-25 22:34 小鲨鱼2018 阅读(2004) 评论(0) 推荐(0) 编辑
摘要:R 语言中双中括号 [[]]与数据类型列表的关系。 for (row in 1:nrow(gterms)) { gene_terms <- str_split(gterms[row,"GOs"], ",", simplify = FALSE)[[1]] gene_id <- gterms[row, 阅读全文
posted @ 2024-03-25 22:27 小鲨鱼2018 阅读(86) 评论(0) 推荐(0) 编辑
摘要:R语言中管道符号 %>% 的应用及举例 gterms <- egg %>% dplyr::select(query, GOs) %>% na.omit() gene2go <- data.frame(term = character(), gene = character()) 阅读全文
posted @ 2024-03-25 22:26 小鲨鱼2018 阅读(59) 评论(0) 推荐(0) 编辑
摘要:R语言中na.omit函数的应用 以及 在数据框中的应用 gterms <- egg %>% dplyr::select(query, GOs) %>% na.omit() gene2go <- data.frame(term = character(), gene = character()) 示 阅读全文
posted @ 2024-03-25 22:25 小鲨鱼2018 阅读(109) 评论(0) 推荐(0) 编辑
摘要:R语言中数据类型列表。 阅读全文
posted @ 2024-03-25 22:20 小鲨鱼2018 阅读(5) 评论(0) 推荐(0) 编辑
摘要: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, 阅读全文
posted @ 2024-03-25 22:18 小鲨鱼2018 阅读(9) 评论(0) 推荐(0) 编辑
摘要:001、基础绘图 plot(1:10) legend('topleft', ## legend函数默认会带有一个框线 c("Presence", "Absence"), col= "royalblue1", pch = 15, cex = 1, text.font = 2, inset= 0.02) 阅读全文
posted @ 2024-03-17 12:04 小鲨鱼2018 阅读(356) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 26 下一页
点击右上角即可分享
微信分享提示