您的位置:首页 > 其它

[R] adding a title to a histogram

2013-10-17 07:39 288 查看
Based on what was told in class, there should be two ways:

Option 1: Adding the title by itself as a single statement, for example, a new line of code:

title("Heart Attack 30-day Death Rate")

Option 2: Adding a "main" part in the hist statement, for example:

hist(outcome[,11], xlab = "30-day Death Rate", main ="Heart Attack 30-day Death Rate")

In RStudio,  the first option does not work well, because there were two titles overlapping: the one I added (whether before or after the hist statement, "Heart Attack 30-day Death Rate") and the one the system generated, "Histogram of Outcome[, 11]".

Therefore, the second option might be a better option, at least in RStudio.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: