上一页 1 ··· 186 187 188 189 190 191 192 193 194 ··· 367 下一页
摘要: 001、startswith、endswith:判定字符串是否以指定字符串开头或者结尾 >>> a = "abcdxyz" >>> a.startswith("a") ## 判定字符串是否以指定字符开头 True >>> a.startswith("b") False >>> a = "abcdef 阅读全文
posted @ 2022-05-22 19:05 小鲨鱼2018 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 001、capitalize:将字符串的第一个字符改为大写,其他字符全部改为小写 >>> a = "abc" >>> b = "ABC" >>> c = "aBc" >>> a.capitalize() ## 将字符串的第一个字符改为大写,其他字符全部改为小写 'Abc' >>> b.capital 阅读全文
posted @ 2022-05-22 00:26 小鲨鱼2018 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 root@PC1:/home/test2# cat a.txt d u s x e j z c e e f a z x e w f e 2、提取以z开头的数据 root@PC1:/home/test2# ls a.txt test.py root@PC1:/home/test2# ca 阅读全文
posted @ 2022-05-22 00:00 小鲨鱼2018 阅读(1026) 评论(0) 推荐(0) 编辑
摘要: 1、 gender <- rep(c("male", "female"), 2) age <- c(20, 30, 26, 32) height <- c(170, 180, 175, 178) dat <- data.frame(gender, age, height) dat aggregate 阅读全文
posted @ 2022-05-21 18:35 小鲨鱼2018 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 95%的置信区间? 1、 set.seed(100) a <- rnorm(100) library(car) qqPlot(a, main="qq plot", col="blue", col.lines="red") ## 绘图 阅读全文
posted @ 2022-05-21 14:09 小鲨鱼2018 阅读(768) 评论(0) 推荐(0) 编辑
摘要: filter函数的使用需要加载dplyr包 1、 a <- 1:10 b <- sample(10, 10) c <- rep(letters[1:5], each = 2) dat <- data.frame(a, b, c) dat library(dplyr) filter(dat, a < 阅读全文
posted @ 2022-05-21 12:21 小鲨鱼2018 阅读(1437) 评论(0) 推荐(0) 编辑
摘要: 管道符的作用:将前一个命令的输出作为后一个命令的输入。 管道符命令的使用需要用到dplyr包。 001、在函数中应用 library(dplyr) f1 <- function(x){return(x + 10)} f2 <- function(x){return(x * 2)} ## 首先定义两个 阅读全文
posted @ 2022-05-21 11:36 小鲨鱼2018 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt d u s x e j z c e e f a x f e w f e 2、提取包含字符x的数据 root@PC1:/home/test2# ls a.txt 阅读全文
posted @ 2022-05-21 00:15 小鲨鱼2018 阅读(1358) 评论(0) 推荐(0) 编辑
摘要: 1、测试数据 2、读取数据 dir() dat <- read.table("a.txt", fill = T, header = F) ## 增加fill = T参数可以读取列数不一致的数据框 dat dat[dat == ""] = NA ## 将缺失值用NA补充 dat 3、简单处理(求第3行 阅读全文
posted @ 2022-05-20 13:11 小鲨鱼2018 阅读(542) 评论(0) 推荐(0) 编辑
摘要: 1、不存在叫'EnsDb.Hsapiens.v86'这个名字的程辑包 2、 BiocManager::install("EnsDb.Hsapiens.v86") library(EnsDb.Hsapiens.v86) 阅读全文
posted @ 2022-05-20 11:04 小鲨鱼2018 阅读(319) 评论(0) 推荐(0) 编辑
上一页 1 ··· 186 187 188 189 190 191 192 193 194 ··· 367 下一页