Skip to content

Remove dplyr and rlang dependencies (Phase 3 dependency reduction) #45

Description

@chris-prener

Summary

Remove dplyr and rlang by replacing all 37 call sites (17 dplyr + 20 rlang) with base R equivalents. This is the largest refactoring phase from the dependency reduction research (#36).

Scope

Not targeted for the next CRAN release. This is a longer-term improvement to pursue after initial CRAN acceptance.

Replacements

dplyr function Base R equivalent Call sites
mutate() transform() / df$col <- multiple
case_when() ifelse() / vectorized logic multiple
select() / rename() bracket indexing + setNames() multiple
left_join() merge(x, y, all.x = TRUE) multiple
`group_by() > summarise()` aggregate() / tapply()
all_of() character vector indexing multiple
rlang function Base R equivalent
enquo() / sym() / quo_name() match.arg() / string-based column selection

Design Considerations

  • Removing rlang requires changing the programmatic column selection API pattern from tidy eval to string-based
  • This may affect internal (non-exported) function signatures but must NOT change the public API
  • tibble class output is lost unless another dependency provides it — functions will return data.frame instead
  • Consider whether data.table is a lighter alternative (single dep replacing dplyr+rlang+tibble+tidyr)

Acceptance Criteria

  • dplyr removed from DESCRIPTION Imports
  • rlang removed from DESCRIPTION Imports
  • All data manipulation rewritten in base R
  • Tidy eval replaced with string-based column selection
  • R CMD check passes with no new NOTEs
  • All existing tests pass
  • No public API behavior changes
  • Performance benchmarked on representative datasets (no >2x regression)

Context

  • Research: docs/requirements/dependency-reduction-recommendations.md
  • Net result: 10 → 8 explicit Imports (after Phases 1 & 2)
  • 7 files affected across R/

Epic

Part of #15 ([Epic A] CRAN Compliance & Release Readiness) — but deferred past initial CRAN submission

Epic

Part of #46 ([Epic E] Dependency Reduction)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions