metrumresearchgroup / lastdose

Fast computation of [time since] and [amount of] the most-recent dose in a data set
3 stars 2 forks source link

Clone amount in case it is modified #41

Closed kylebaron closed 1 year ago

kylebaron commented 1 year ago

Summary

When amt contains missing values, they need to be filled with 0 and they are in the C++ code. However, the data passed to the C++ code were still pointers to the columns in the data frame and the source data frame was getting modified (see #40).

This PR implements a clone() step so amt isn't modified in the source data frame.