### Bug description

I wasn't completely sure if this was better suited for the cli repo or the R repo, but here we are. The `tidytable` package recently introduced dotless versions of functions in its dev version (e.g. `mutate.() -> mutate()`), with one of them being its own version of `base::ifelse()` that ultimately calls `data.table::fifelse()` under the hood. It seems the stricter type checking of `fifelse` isn't playing nicely with a function that's calling `knitr`'s plot hook functions. The below fails on both html and pdf rendering:

````
---
format: html
---

```{r}
data("mtcars")

# devtools::install_github("markfairbanks/tidytable")

library(tidytable)

plot(mtcars$mpg, mtcars$cyl)
```
````

```
processing file: plot_example.qmd
  |.......................                                               |  33%
  ordinary text without R code

  |...............................................                       |  67%
label: unnamed-chunk-1
Quitting from lines 6-13 (plot_example.qmd) 
Error in fifelse(condition, args$true, args$false, args$missing) : 
  'yes' is of type NULL but 'no' is of type character. Please make sure that both arguments have the same type.
Calls: .main ... run_hook_plot -> hook -> ifelse -> if_else -> fifelse

Execution halted
```

I haven't had the time to read through the rmd-related code super closely, but I *think* it may be coming from [line 162](quarto-dev/quarto-cli/blob/main/src/resources/rmd/execute.R#L162) of `execute.R` since that's the only `ifelse` I've come across so far that seems like it could return two different types.

For posterity and completeness' sake, both PCs I've tested this on are running Windows 10 with the 1.1.168 cli. Any dev version of `tidytable` after [this commit](https://www.github.com/markfairbanks/tidytable/commit/83b826060a126c1974d18c4646b6739fdbfdbedc) will produce the error. Finally, the error doesn't occur if knitting an .rmd with the same code as above.

```
quarto help

 Usage:   quarto
 Version: 1.1.168

Description:

Quarto CLI
```

```
packageVersion("knitr")

1.39
```

In the meantime, I've been calling `conflicted::conflict_prefer("ifelse", "base")` to get around the issue.

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [x] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
cderv
2022-09-15T14:47:34Z
mattsams89
bug
v1.3
closed
Fatal error while rendering plots when `base::ifelse()` is masked by a stricter R function
https://github.com/quarto-dev/quarto-cli/issues/2454