Writing your manuscript in R Markdown
Integrating your code directly into your paper so you never have to type values into a results section again
Last updated
Integrating your code directly into your paper so you never have to type values into a results section again
Last updated
Have you ever been writing up an article for publication when suddenly you realize that you ran your statistics on the wrong subset of participants, and now you need to re-run all your analyses and change every value in your entire paper? What a nightmare!
With R Markdown, say goodbye to these types of scenarios. Instead, you can import values directly from your analysis code! R Markdown is great for:
reproducible manuscripts
keeping track of where values are generated
taking care of formatting so you don't have to
having changes you make in one section percolate through the entire manuscript
easily incorporating figures without saving them as images
Since we need to make manuscripts that match APA formatting, we use . Papaja will take care of most formatting for you, so you can spend your time thinking about other things.
Tables are sometimes a bit difficult to format in R Markdown because you can't just click and drag cells to do what you want. Packages like can help you with these kinds of issues
Of course, you'll use the packages presented in the tidyverse which you can learn more about in the Data Analysis section of this gitbook.
Unlike most word processors, all of the formatting happens during a single process called "knitting." During knitting, any errors that you have in your manuscript can potentially stop your manuscript from running. Here is a running list of possible errors and how they can be solved:
This means something is wrong with the part of the manuscript where you provide the title, abstract, and authorship information. Check that everything is indented correctly etc.
This means that somewhere after that line, the error has occurred. Check all your code chunks and your in-line values for errors
Sometimes you'll try to reference a figure and instead of saying a figure number it'll say "Figure ???" This is usually a sign that there's a typo in your reference, or that your figure has something illegal in its caption like a % or something. If you want to use special characters in your figure captions, write them with two backslashes preceding them, e.g. "Grey line indicates 50\\% accuracy"