Skip to content

Bug with "@import"ed data packages #1424

Closed
@russHyde

Description

@russHyde

To reproduce:

In RStudio File -> New Project -> New Directory -> R Package
Package name = "temptanic"

This adds a package skeleton with R/hello.R. Running lintr::lint_package() flags a single whitespace lint in hello.R (irrelevant to the issue)

Add an R script to the package that imports the {titanic} package (https://cran.r-project.org/web/packages/titanic/index.html).

# dummy-imports.R

#' @import titanic
#'
NULL

Delete the initial NAMESPACE
Document the package - we see import(titanic) in NAMESPACE

Lint the {temptanic} package:

lintr::lint_package()
.Error in data.frame(pkg = ns, fun = getNamespaceExports(ns), stringsAsFactors = FALSE) : 
  arguments imply differing number of rows: 1, 0

(The same thing happens whether or not {titanic} is added to {temptanic}::Imports or Suggests)

Note the following:

> getNamespaceExports("titanic")
character(0)

As such, data.frame(pkg = "titanic", fun = getNamespaceExports("titanic"), stringsAsFactors = FALSE) complains due to mismatched argument lengths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorgood first issue ❤️good issue for first-time contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions