Skip to content

Commit

Permalink
Implement own ncol() to avoid calling dim()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jul 8, 2024
1 parent 0005f67 commit 64f3f81
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/ncol.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# We avoid ncol() from base R because it calls dim(),
# and that would materialize an ALTREP duckplyr data frame.
ncol <- function(x) {
length(x)
}

0 comments on commit 64f3f81

Please sign in to comment.