On 08/09/2018 6:25 AM, akshay kulkarni wrote:
dear members,
I am facing difficulties in plotting histograms
in R in Linux CLI.
Is there a function in R which produces a table of frequency distribution in
figures rather than plot that distribution?
Something like this:
xht <- c(1,2,3,4,5,6,7,8,9,10)
required table:
bins: 1-2 3-4 5-6
7-8 9-10
frequency: 2 2 2
2 2
Also is this possible:
xhth <- hist(xht)
summary(xhth)
You could use
table(cut(xht, breaks=2*(0:5)))
which produces
(0,2] (2,4] (4,6] (6,8] (8,10]
2 2 2 2 2
for your dataset.
Duncan Murdoch
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.