smooth_parse | R Documentation |
smooth_algorithm()
FunctionThis function transforms the data to obtain the daily treatment.
smooth_parse(
id,
start_date,
end_date,
drug,
study_from = min(start_date),
study_to = max(end_date)
)
id |
Unique identifier of the patient. |
start_date |
Start date of the treatment. |
end_date |
End date of the treatment. |
drug |
Name of the drug used. |
study_from |
A date indicating when the study start. |
study_to |
A date indicating when the study finish. |
A data.frame with the following structure:
Unique identifier of the patient.
Name of the drug used.
Day of the treatment.
Number of drugs used in the treatment
library(smoothy)
library(dplyr)
data(drugstreatment)
df <- drugstreatment |>
filter(id == "01f13c15-d9f1-4106-a04f-976c457edd0a")
structured_df <- smooth_parse(
id = df$id,
start_date = df$start_date,
end_date = df$end_date,
drug = df$drug,
study_from = "1970-01-01",
study_to = "1975-01-01"
)
head(structured_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.