Unbalanced panel data in prodest package in R
A common technique we use in Python through Pandas is the introduction of means, medians and modes (depending on the structure of data) in the stead of these missing values.
Another great technique is introducing fitted values by a regression model, thus, predicting the missing values. In this case you'd want a command to drop your NaNs, estimate a model, and replace empty cells with their fitted value. Depending on your data's structure, you might encounter problems with this technique.
As a final comment, I'd suggest you use Python. Here's the pertinent website.