可视化R中的摘要统计信息

时间:2019-02-03 16:37:31

标签: r

如何根据以下数据摘要在R中创建饼图和条形图:

sudo systemctl restart httpd.service

1 个答案:

答案 0 :(得分:1)

尝试:

gender <- c(518, 482)
names(gender) <- c("male", "female")
pie(gender, names(gender))
barplot(gender)

与您的其他类别相同,例如

groups <- c(89, 190, 319, 262, 140)
names(groups) <- c("A", "B", "C", "D", "E")
pie(groups, names(groups))
barplot(groups)

返回:

enter image description here