Filling in missing (blanks) in a data table, per category - backwards and forwards
问题 I am working with a large data set of billing records for my clinical practice over 11 years . Quite a few of the rows are missing the referring physician. However, using some rules I can quite easily fill them in but do not know how to implement it in data.table under R. I know that there are things such as na.locf in the zoo package and self rolling join in the data.table package. The examples that I have seen are too simplistic and do not help me. Here is some fictitious data to orient you