I'm trying to use [include](https://quarto.org/docs/authoring/includes.html) to allow re-use of custom created functions across multiple bookchapters. When doing so I encountered multiple unexpected behaviors which I will describe below. Please note: I realize an easy solution to the problem is to include an codeblock where the file is sourced. Neverthless I wasn't sure whether the behaviors were known, expected, and/or desired.

1. The included file must be stored in the same directory as the to-be-rendered file.
I'm working on a book where I have the toplevel files (e.g., `_quarto.yml`; `_functions.R`). I then have each bookchapter stored in a folder called `chapters`. When I want to include (`_functions.R`) in a bookchapter (e.g., `chapters/intro.qmd`) an error occurs when redering: `ERROR: Include directive failed.` If I place the `_functions.R` file also in the `chapters` folder this issue no longer occurs.

2. Including an `.R` file shows the script as regular text instead of executing code
Upon re-reading the documentation this is expected behavior as only `.qmd` and `.md` files are mentioned as suited. However, I somehow expected that you could also include normal .R code - which perhaps others might expect as well.
2022-08-15T19:52:07Z
SHogenboom
closed
Unexpected Include Behavior
https://github.com/quarto-dev/quarto-cli/issues/1903