Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 在条形图顶部添加频率_R - Fatal编程技术网

R 在条形图顶部添加频率

R 在条形图顶部添加频率,r,R,我试图在条形图上添加每个条形图的频率,但我找不到 将代码附在R下 多谢各位 barplot(sort(CSP1,decreasing = T),ylim = c(0,0.35), xlab="Profession", ylab = "Frequence", main = "Diagramme montrant la fréquence des différentes profession en Fr

我试图在条形图上添加每个条形图的频率,但我找不到

将代码附在R下

多谢各位

barplot(sort(CSP1,decreasing = T),ylim = c(0,0.35),
        xlab="Profession",
        ylab = "Frequence",
        main = "Diagramme montrant la fréquence des différentes profession en France",)

您可以使用
text()
函数在条形图上方添加值

以下是如何使用
条形图
帮助文件中使用的
数据:

data("VADeaths")
mp <- barplot(VADeaths)
tot <- colSums(VADeaths)
text(mp, tot + 3, format(tot), xpd = TRUE, col = "blue")
数据(“VAD”)

克莱门特议员,欢迎来到SO!您的问题有些常见,因此有几种好的解决方案(在结束语中有两个链接)。今后,请让您的问题重现。除了您提供的示例代码外,这还包括示例明确的数据(例如,
dput(head(x))
data.frame(x=…,y=…)
)以及给定该输入的预期输出。参考文献:,和。把它当作一个傻瓜来结束并不是坏事,它只会鼓励现有的答案上升到顶端。谢谢(顺便说一句,克莱门特…仅仅因为我把它标记为一个傻瓜并不意味着(我相信)你不能接受@DanY对你来说已经足够好的答案。这是一个普遍的礼仪。请给DanY荣誉。谢谢!)