This function looks like it was copy-pasted from the R console when you type `loadNamespace` (and has been reformatted by R). Could you replace with the code directly from r-source, with the original formatting? You can find it here: https://github.com/wch/r-source/blob/trunk/src/library/base/R/namespace.R#L484