empty name in directive 'import' in 'NAMESPACE' file

Viewed 363

When trying to install my package from gitlab I am getting the error message

Fehler in asChar(e[-1L]) : 
  empty name in directive 'import' in 'NAMESPACE' file

resulting in

installation of package ‘...’ had non-zero exit status

My NAMESPACE file looks as follows:

# Generated by roxygen2: do not edit by hand

export(daten_generieren)
export(erzeuge_COVID_grafik)
export(num_zsmfassen)
import(dplyr)
import(magrittr)

I am not sure what the error message means or how to resolve the issue. I would guess that the error means that do not have any imports but that is of course not the case.

1 Answers

I had a similar problem when using devtools::document() and got your weird error message - Error in asChar(ivars) : empty name in directive 'importFrom' in 'NAMESPACE' file.

Following advice from roxygen2 github discussion - I removed the NAMESPACE file and rebuilt it with roxygen2 and it went away.

https://github.com/r-lib/roxygen2/issues/1137

Related