0

I am trying to load a file from inside a code chunk in a papaja document

This is my header

---
title             : "The title"
shorttitle        : "Title"

author: 
  - name          : "First Author"
    affiliation   : "1"
    corresponding : yes    # Define only one corresponding author
    address       : "Postal address"
    email         : "my@email.com"
    role:         # Contributorship roles (e.g., CRediT, https://casrai.org/credit/)
      - Conceptualization
      - Writing - Original Draft Preparation
      - Writing - Review & Editing
  - name          : "Ernst-August Doelle"
    affiliation   : "1,2"
    role:
      - Writing - Review & Editing

affiliation:
  - id            : "1"
    institution   : "Wilhelm-Wundt-University"
  - id            : "2"
    institution   : 

authornote: 
abstract: 
keywords          : "keywords"
wordcount         : "X"

bibliography      :

floatsintext      : no
figurelist        : no
tablelist         : no
footnotelist      : no
linenumbers       : no
mask              : no
draft             : no
header-includes   :    
documentclass     : "apa6"
classoption       : "man"
output            : 
  papaja::apa6_pdf:
    latex_engine: xelatex
---

And my code chunk

``` {r load file}
load("C:/Users/Raphael/Documents/git/masterarbeit/analysis/coding/debugging/issues/missing_viz.Rda")
```

If I load the file from the console, everything works fine. However, when I try to knit the document, I get the following error:

File  not found in resource path
Error: pandoc document conversion failed with error 99
Execution halted

I am getting the same error message if I do

``` {r load file}
load("missing_viz.Rda")
```

(I thought that I might have a problem with having the Rmd and file not in the same folder, as in https://community.rstudio.com/t/pandoc-document-conversion-failed-with-error-99/18035 - but they are!).

Does anyone have an explanation? Imo even if not having the .Rda in .Rmd in the same folder, the command should work if I specify the full path.

raphael_ldl
  • 113
  • 8
  • This seems to be a problem with papaja. When I change the output type to "pdf_document", the file is being knitted without problem. – raphael_ldl Dec 17 '21 at 14:15

1 Answers1

0

You did not specify a valid path to a bibliography file in the YAML header. This is why pandoc can't find the file. You must either specify a relative or absolute file path to a .bib file or completely remove the YAML key bibliography: (i.e., delete the respective line of code in the YAML header).

Marius Barth
  • 596
  • 2
  • 9