上一页 1 ··· 325 326 327 328 329 330 331 332 333 ··· 367 下一页
摘要: 1、 > a <- c(3,NA,NA,4,1,5) > b <- c(NA,4,6,2,4,9) > c <- data.frame(a,b) > c a b 1 3 NA 2 NA 4 3 NA 6 4 4 2 5 1 4 6 5 9 > c[is.na(c)] <- 0 > c a b 1 3 阅读全文
posted @ 2021-01-12 14:30 小鲨鱼2018 阅读(10861) 评论(0) 推荐(0) 编辑
摘要: 1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、隐去x轴 p + xlab(NULL) 3、 隐去y轴 p + ylab(NULL) 阅读全文
posted @ 2021-01-10 15:06 小鲨鱼2018 阅读(536) 评论(0) 推荐(0) 编辑
摘要: 1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、调整x轴 p+theme(axis.title.x=element_text(vjust=2, size=20,face = "bold")) p+theme(a 阅读全文
posted @ 2021-01-10 13:37 小鲨鱼2018 阅读(18697) 评论(0) 推荐(0) 编辑
摘要: 1、 library(gcookbook) library(ggplot2) p=ggplot(heightweight,aes(x=sex,y=heightIn))+geom_violin() p 2、指定x轴因子水平顺序 heightweight$sex<-factor(heightweight 阅读全文
posted @ 2021-01-10 13:11 小鲨鱼2018 阅读(2351) 评论(0) 推荐(0) 编辑
摘要: 1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、调整绘图边框的粗细 p + theme(panel.border = element_rect(fill=NA,color="black", size=5, li 阅读全文
posted @ 2021-01-10 12:44 小鲨鱼2018 阅读(16385) 评论(0) 推荐(0) 编辑
摘要: 1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、调整x轴 p+theme(axis.line.x=element_line(linetype=1,color="black",size=3)) 3、调整x轴刻度线 阅读全文
posted @ 2021-01-10 12:38 小鲨鱼2018 阅读(14144) 评论(2) 推荐(2) 编辑
摘要: 1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、去除图例 p + theme(legend.position = 'none') 阅读全文
posted @ 2021-01-10 12:22 小鲨鱼2018 阅读(13191) 评论(0) 推荐(0) 编辑
摘要: 1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、去除背景色 p + theme_bw() 3、去除网格线 p + theme_bw() + theme(panel.grid=element_blank()) 阅读全文
posted @ 2021-01-10 12:19 小鲨鱼2018 阅读(25031) 评论(0) 推荐(1) 编辑
摘要: 1、 #include <stdio.h> #define NUMBER 7 int main(void) { int i, a[NUMBER]; for (i = 0; i < NUMBER; i ++) { printf("NO.[%d] = ", i + 1); scanf("%d", &a[ 阅读全文
posted @ 2021-01-09 13:44 小鲨鱼2018 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main(void) { int a[7] = {45,32,86,56,24,98,85}; int min, max; min = a[0]; max = a[0]; int i; for (i = 0; i < 7; i ++) { if (a[i 阅读全文
posted @ 2021-01-09 12:55 小鲨鱼2018 阅读(6433) 评论(0) 推荐(0) 编辑
上一页 1 ··· 325 326 327 328 329 330 331 332 333 ··· 367 下一页