摘要: 1 绘图 1.1 条形图 barplot() (针对离散型变量) library(vcd) dat<-Arthritis counts<-table(dat$Improved) #table求数据框中间取值的频数 (1)简单条形图(一个变量,一维) barplot(counts,main="Simp 阅读全文
posted @ 2021-07-04 20:26 zhang-X 阅读(5885) 评论(0) 推荐(0)
摘要: 1 控制流 1.1 重复和循环 方式一:for() for (i in 1:10) print("hello") 方式二:while() while(i>0){ print("hello") i<-i-1 } 1.2 条件执行 方式一:if-else结构 if (is.character(roste 阅读全文
posted @ 2021-07-04 14:56 zhang-X 阅读(598) 评论(0) 推荐(0)
摘要: 1 数据处理案例 (1)数据输入 student<-c("John Davis","Angla williams","Bullwink Moose", "David Jones","Janice Markhammer","cheryl Cushing", "Revenen Ytzrhak","Gre 阅读全文
posted @ 2021-07-04 13:40 zhang-X 阅读(1530) 评论(0) 推荐(0)
摘要: 1 高级数据管理 1.1 数值和字符处理函数 (1)数学函数 绝对值函数:abs() 取整函数:floor(),取不大于这个数的整数 取对数函数:log(),log10() 四舍五入函数:round() (2)统计函数 均值函数:mean() 方差函数:var() 标准差函数:sd() 分位数函数: 阅读全文
posted @ 2021-07-04 13:36 zhang-X 阅读(659) 评论(0) 推荐(0)