Count the cases after the first entry
I would like to calculate the number of cases following the initial record in a data panel (detect dropout). Could someone assist me with the methodology or provide guidance on how to achieve this?
data.table vs dplyr: apply function returning changing column names over groups
I want to apply a function (ratefunc()
) to a grouped data frame which returns changing column names dependent on the result:
How to split multiple fields in a data.table and expand the rows correspondingly in R?
I am working with a data.table
in R where multiple fields can contain multiple values separated by semicolons. I am trying to separate these values into individual rows, with each value corresponding to a new row in the table. However, the challenge is that the separate fields are related and need to be split and expanded correspondingly.