uptake / pkgnet

R package for analyzing other R packages via graph representations of their dependencies
https://uptake.github.io/pkgnet/
Other
155 stars 37 forks source link

CreatePackageReport() fails on empty assignment in data.table() #255

Closed jameslamb closed 7 months ago

jameslamb commented 5 years ago

I'm unsure of the exact issue, but the following code

pkg_name <- YOUR_PACKAGE_NAME
CreatePackageReport(
    pkg_name
    , report_path = file.path(getwd(), "report.html")
)

Yields an error like the following on the Function Network tab (generated by FunctionReporter):

## Error in data.table::data.table(node = funs, type = "function"): Item 1 has no length. Provide at least one item (such as NA, NA_integer_ etc) to be repeated to match the 1 row in the longest column. Or, all columns can be 0 length, for insert()ing rows into.

I've observed this error for the following packages:

discovered via the code in #252

jameslamb commented 5 years ago

I've observed that most of the packages on this list also have 0 dependencies in the report produced by DependencyReporter, with a message like this on the Dependency tab

## Error in log_fatal(sprintf(msg, self$pkg_name, paste(private$dep_types, : Package 'gamair' does not have any dependencies in [Imports, Depends]. If you think this is an error consider adding more dependency types in your definition of DependencyReporter. For example: DependencyReporter$new(dep_types = c('Imports', 'Depends', 'Suggests'))