摘要: 001、 dat <- data.frame( rep1 = sample(1:20), rep2 = 20:1, rep3 = 1:20 ) dat image(1:20, 1:3, as.matrix(dat)) ## 参数需要是矩阵 阅读全文
posted @ 2022-08-29 21:27 小鲨鱼2018 阅读(249) 评论(0) 推荐(0) 编辑
摘要: par(mar = ...)、par(mar = ...)均为调整绘图区域与边框之间的距离。 001、 par(mfrow = c(2, 2)) plot(1:10, cex = 3, col = "red", pch = 19) par(mar = c(7, 7, 7, 7)) plot(1:10 阅读全文
posted @ 2022-08-29 15:35 小鲨鱼2018 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 001、grep a <- c("cc", "ee", "ff", "gg", "aa", "bb", "dd") grep("aa", a) ## 返回匹配字符的位置索引 grep("aa", a, value = T) ## 直接返回值 002、grepl a <- c("cc", "ee", 阅读全文
posted @ 2022-08-29 15:09 小鲨鱼2018 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 001、 a <- par() class(a) ## par函数返回列表 length(a) ## 一共72个可选项 head(a, 3) par()$mfrow par(mfrow = c(2, 2)) ## 修改par中的参数 par()$mfrow 阅读全文
posted @ 2022-08-29 14:26 小鲨鱼2018 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 001、floor 向下取整 floor(5.3435) floor(3.8735) 002、round 四舍五入取值 round(5.3435) ## 默认保留小数点后0位 round(5.9435) round(5.3435, digits = 2) ## 保留小数点后2位 round(5.94 阅读全文
posted @ 2022-08-29 00:01 小鲨鱼2018 阅读(1131) 评论(0) 推荐(0) 编辑