Frequency Table in r

can the frequency of each variable(event) be increase in a frequency table ?
for example:
v:[0,1) [1,6) [6,15) [15,18) [18,21) [21,25) [25,40) [40,60) [60,65) [65,113]
f: 1 5 9 3 3 4 15 20 5 49

can I then modified this frequency table such that
v:[0,1) [1,6) [6,15) [15,18) [18,21) [21,25) [25,40) [40,60) [60,65) [65,113]
f: 400 59 234 873 903 5664 815 720 65 749

v represent variable which are age intervals
f frequency

I don't understand the question, could you provide a reproducible example?

For example, if you have a vector x, you can get such a frequency table with cut() (to assign each observation to an interval), and table() (to count the number of observations in each interval:

# generate fake data
set.seed(1)
x <- round(113*runif(100))

# Cut into intervals and generate frequency table
table(cut(x, breaks = c(1,6,15,18,21,25,40,60,65,113)))
#> 
#>    (1,6]   (6,15]  (15,18]  (18,21]  (21,25]  (25,40]  (40,60]  (60,65] 
#>        2        8        1        2        4       14       23        2 
#> (65,113] 
#>       44

Created on 2022-05-23 by the reprex package (v2.0.1)

In your data, I'm not sure if you started from such a vector x, how the breakpoints were chosen, and how the "modified" frequency table was obtained from the first one.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.