-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
I want to call dfSummary
within my function. However, it will give me the following error when I turn the rmd file into HTML:
Error in `if (done) ...`:
! argument is not interpretable as logical
Backtrace:
▆
1. └─summarytools::dfSummary(df)
2. └─summarytools:::parse_call(...)
3. └─summarytools:::deduce_names()
However, this issue only exists when I knit the whole file, I cannot trigger it within my terminal. The issue seems related to how dfSummary
parses R's call stack, as the error only exists for some specific functions. Here is a simple reprex
## install/load packages
library(summarytools)
dfSummaryEX <- function(df) {
df|> dfSummary() |> print(method = 'render')
}
summaryEX <- function(df) {
df|> dfSummary() |> print(method = 'render')
}
This will give you the error
dfSummaryEX(data.frame(x=1:10))
This, though literally does the same thing, will not give you error
summaryEX(data.frame(x=1:10))
I do not know the exact implementation for this, but I guess you might use a regular expression to match the call name?
Metadata
Metadata
Assignees
Labels
No labels