The units of quantities are conveniently ignored in the definition of a derivative, but they should not be. A derivative should be defined as a function of two quantities, both with their own units:
where r’ is a vector function of two quantites and r is a vector functon of one quantity. The second derivative is then a function of three quantities, each with their own units:
Other derivatives should be defined similarly.