ddediu / AdhereR

Computation of adherence to medications from Electronic Healthcare Data in R
26 stars 6 forks source link

interactive CMA R code to copy - quotes for CMA.to.apply in sliding window and per episode #130

Closed alexadima closed 4 years ago

alexadima commented 4 years ago

When accessing "the R code for the current plot" to copy to clipboard, the CMA type parameter in the CMA calculation appears without quotes. Running it in R directly gives the following warning:

Warning message: In .report.ewms(paste0("'CMA.to.apply' must be a string contining the name of the simple CMA to apply!\n)"), : 'CMA.to.apply' must be a string continuing the name of the simple CMA to apply!

# Compute the appropriate CMA:
 cma <- CMA_per_episode(data=.data.for.selected.patients.,
                        CMA=CMA1,
                        # (please note that even if some parameters are
                        # not relevant for a particular CMA type, we
                        # nevertheless pass them as they will be ignored)
                        ID.colname="PATIENT_ID",
                        event.date.colname="DATE",
                        event.duration.colname="DURATION",
                        event.daily.dose.colname="PERDAY",
                        medication.class.colname="CATEGORY",
                        carry.only.for.same.medication=FALSE,
                        consider.dosage.change=FALSE,
                        followup.window.start=0,
                        followup.window.start.unit="days",
                        followup.window.duration=730,
                        followup.window.duration.unit="days",
                        observation.window.start=0,
                        observation.window.start.unit="days",
                        observation.window.duration=730,
                        observation.window.duration.unit="days",
                        medication.change.means.new.treatment.episode=FALSE,
                        dosage.change.means.new.treatment.episode=FALSE,
                        maximum.permissible.gap=0,
                        maximum.permissible.gap.unit="days",
                        date.format="%m/%d/%Y"
                       );

adding quotes manually to the parameter value fixes this.

ddediu commented 4 years ago

Fixed