GithubHelp home page GithubHelp logo

crsh / papaja Goto Github PK

View Code? Open in Web Editor NEW
645.0 26.0 132.0 16.36 MB

papaja (Preparing APA Journal Articles) is an R package that provides document formats to produce complete APA manuscripts from RMarkdown-files (PDF and Word documents) and helper functions that facilitate reporting statistics, tables, and plots.

Home Page: https://frederikaust.com/papaja_man/

License: Other

R 38.51% TeX 10.26% Lua 1.06% Shell 0.12% JavaScript 2.05% HTML 48.01%
rmarkdown apa journal apa-guidelines psychology r manuscript reproducible-paper reproducible-research r-package

papaja's Issues

Rescaling of tables to fit the page

I'm having trouble with getting tables to be rescaled to fit the page. Below is the table I'm using (and I've also tried using the xtable and ztable packages as well as basic markdown tables):

\begin{table}[htbp]
\center
\caption{Original DAST-10}
\label{table1}
\begin{tabular}{cl}
\toprule
& Item
\toprule
1 & Have you used drugs other than those required for medical reasons?
2 & Do you use more than one drug at a time?
3 & Are you always able to stop using drugs when you want to? (-)
4 & Have you ever had blackouts or flashbacks as a result of drug use?
5 & Do you ever feel bad or guilty about your drug use?
6 & Does your spouse (or parents) ever complain about your involvement with drugs?
7 & Have you neglected your family because of your use of drugs?
8 & Have you engaged in illegal activities in order to obtain drugs?
9 & Have you ever experienced withdrawal symptoms (felt sick) when you stopped taking drugs?
10 & Have you had medical problems as a result of your drug use (e.g., memory loss, hepatitis, convulsions, bleeding)?
\bottomrule
\end{tabular}
\end{table}

arrange_anova() throws error for summary.aov-object

When I pass an aov object from repeated-measures ANOVA to apa_print, it fails now:

Fehler in UseMethod("arrange_anova", x) :
nicht anwendbare Methode für 'arrange_anova' auf Objekt der Klasse "c('summary.aov', 'listof')" angewendet

Why did you do that?

Confidence intervals for eta^2s

apa_print() provides confidence intervals for R² (lm) but as of now no confidence intervals are calculated for ANOVA objects.

Create classes for table output from apa_print()

If we define classes with attributes for the tables produced by apa_print() it would be possible to automatically create sensible table notes containing, e.g., R² for regression models etc.

Add a blacklist to cite_r()

Currently, cite_r() has a white list of packages to cite (pkgs), but it would be probably be much more useful to have a black list of packages not to cite. This would prevent situations in which a package is later added to the analysis script but not to the call of cite_r.

Hanging indents for bibliography

My understanding is that current APA style requires the bibliography to use hanging indentation (i.e. the first line is normal, all the following lines are indented, for each reference). I didn't see an option to change this in the documentation.

Scaling of images in MS Word

I experienced so problems with image scaling when knitting MS Word documents. Embedded images ![](...) are scaled down and distorted (PDF) while plot generated from R are not scaled to fit the page with the custom settings. Maybe we can adjust the chunk defaults depending on the output format?

double comma if I leave out 'note' in template

If I do not specify a note in my .Rmd template, I erroneously get two commas on the first page of the manuscript:

Correspondence concerning this article should be addressed to Donald Duck**, ,**
Gansstr. 2, 12345 Entenhausen, Germany.

I can replicate this in the example file example.Rmd of this repository if I simply remove the note:

note: |

Currently, a development version of papaja is available at https://github.com/crsh/papaja.

I do not think that this is the desired behaviour, if I do not want to insert a note?

Reference Formattign

The references do not come out according to APA 06 (hanging indent), but rather they are indented on the first line. How would I fix this issue?

apa_table

Do I need to do anything in addition to installing papaja to get the apa_table function to work? I get the following error when I try and run your code from the example document (i.e., cars descriptives):

Error in apa_table.latex(...) : could not find function "validate"

It is for this reason that I've been trying to use LaTeX code to create a table. A second problem of mine, however, is I don't know where to add \usepackage{}. For example, with the table I've tried \usepackage{adjustbox} or tabularx, as suggested by you, but I get an error.

Landscape pages

Is there any possibilty to add landscape pages (i.e., for large tables) to the document? I understood that I need the pdflscape environment in TeX to do so, but including this package in the yaml header doesn't change anything in papaja documents, while these features are accepted in standard RStudio pdfs. Is there a convenient way to load additional TeX environments?

My code:
includes:
in_header: \usepackage{pdflscape}

Add sanity checks

As of now there are no sanity checks for function inputs. In order to receive meaningful warnings and errors basic sanity checking of input would be nice.

Create a doc-reference-file for MS Word

Let's see if we can create a MS Word reference-file to make Word documents look like apa6-documents when the class is set to doc. Also: Is it possible to set reference-docx in the yaml-header conditional on the selected document class?

class: jou not working

When using class: jou I get the error:

! LaTeX Error: Something's wrong--perhaps a missing \item. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.141 pandoc.exe: Error producing PDF from TeX source Error: pandoc document conversion failed with error 43

This happens with newest papaja, R 3.2.1 and newest RStudio 0.99.442 under Windows 10 with MikTeX and Ubuntu 14.04 with TeX Live. All documents I tried work fine with class: doc and class: man. This error is reproducible with the standard example document. Please correct me if I'm missing something here.

Explore alternate way to use apa6 document class

An alternative to delivering a hard copy of the apa6 document class, which we do right now, would be to use the version shipped with the LaTeX-distribution:


---
title: "Untitled"
author: "Author"
output: pdf_document
classoption: "man"
documentclass: "apa6"
geometry: false

---

However, this way we would need to include some additional arguments in the preamble, which could be done with includes in the yaml-header, the _output.yaml-file, or the format-function.

apa_lineplot()

Create a function that uses the same parameters as apa_barplot(), but draws nice lineplots

ERROR

Fehler in rmarkdown::pdf_document(template = template, fig_caption = fig_caption, :
unbenutztes Argument (keep.tex = keep.tex)
Calls: ... create_output_format -> do.call -> ->
Ausführung angehalten

APA article created using rmarkdown::render(), not rmarkdown::draft()

Today I got papaja to run outside of RStudio in Ubuntu 14.04. It was not easy because it took me some time to install a recent version of pandoc and then call it from within R.

In the readme file of this repository you describe to use rmarkdown::draft() in order to create an APA article if you are not using RStudio [ like this: rmarkdown::draft("mymanuscript.Rmd", template = "apa6", package = "papaja") ]. This does not seem to work for me. I get this error message: The file 'mymanuscript.Rmd' already exists.

If I just use a different file name I get a weird .rmd document containing this abstract:

"abstract: In der Rede wird folgende These diskutiert: "Optozentristisch durchseucht sind Philosophie und die Wissenschaft. [...]"

It seems that draft() does not create a .pdf file, but rather tries to create a new file from a template (see http://rmarkdown.rstudio.com/developer_document_templates.html)

To create a papaja APA6 article, I needed to use the rmarkdown function render(), instead of draft(). Using rmarkdown::render(), I could replicate creating your example article as well as articles that contained changes. How to use it:

render("myExample.rmd", output_file="myExample.pdf")

tl;dr: If you are using papaja outside of RStudio, it is possible that you can only create an article by calling rmarkdown::render(), not rmarkdown::draft().

apa_table() doubles row names

When I use apa_table() to insert a table into a papaja::apa6_pdf document, this table will have two rows containing the row names of the matrix that I passed to apa_table() (also happens if I pass a data.frame instead). If I replicate the example from the ?apa_table() documentation, it looks like this:


Descriptives speed dist


Mean Mean 15.4 42.98

SD SD 5.29 25.77

Min Min 4 2

Max Max 25 120


This does not happen if I directly call kable() instead. I am using papaja_0.1.0.9000.

Option to add significance indicators to apa_table()

It would be nice if there was an option to add significance indicators to a apa.table(), e.g. for correlation tables, by passing a matrix of the same dimensions that contains p-values (s. corr.test() from the psych-package) or by passing a matrix of the same dimensions with logicals to add indicators of something entirely different.

Create unit tests

Unit tests for results of printnum(), apa.stat(), and subfunctions using testthat-package.

supress NULL output of data.table plots

When printing plots from a data.table in the form DT[,plot(xy)], data.table returns NULL next to the plot. This NULL is also printed in the apa manuscript.

Example:

dat <- data.table(x=1:10,y=11:20,subj=rep(c(1,2),5))
dat[subj==1,plot(x,y)]
dat[subj==2,lines(x,y)]

Character encoding of abstract and note sections in MS Word

When knitting the standard papaja template to a .docx file non-ascii characters (I tested ÄÜÖäüö߀) in the abstract and the note sections of the word document are seemingly not encoded correctly. The same characters are displayed properly when used in the title or outside the header in the normal document text. Characters are also displayed properly in the two sections when knitting a pdf file.

I am using MikTex 2.9.5105 and the latest development version of papaja. To view the .docx file I use MS Word 2013.

Make apa_table() take tabular-objects

The tables packages provides a powerful interface to produce tables from the data. It would be nice if we found a way to make this work with apa.table(). As it is, tabular objects can be used to produce pretty tables in LaTeX but we would need to find a way to make it work with Markdown/Pandoc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.