[R] Data manipulation problem
Erik Iverson
eriki at ccbr.umn.edu
Mon Apr 5 20:52:24 CEST 2010
?cut to create categories
?table to make the table
moleps wrote:
> Dear R´ers.
>
> I´ve got a dataset with age and year of diagnosis. In order to age-standardize the incidence I need to transform the data into a matrix with age-groups (divided in 5 or 10 years) along one axis and year divided into 5 years along the other axis. Each cell should contain the number of cases for that age group and for that period.
>
> I.e.
> My data format now is
> ID-age (to one decimal)-year(yearly data).
>
> What I´d like is
>
>
> age 1960-1965 1966-1970 etc...
> 0-5 3 8 10 15
> 6-10 2 5 8 13
> etc..
>
>
> Any good ideas?
>
> Regards,
> M
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
More information about the R-help
mailing list