Skip to content
Permalink
Browse files

Updates example document, README, and NEWS

  • Loading branch information...
crsh committed Aug 5, 2016
1 parent f828300 commit 3df2f19897f678f66e220e79269fe27b42e4d9bc
Showing with 153 additions and 34 deletions.
  1. +1 −2 .Rbuildignore
  2. +1 −0 .gitignore
  3. +82 −13 NEWS.md
  4. +4 −4 README.Rmd
  5. +3 −4 README.md
  6. +13 −11 example/example.Rmd
  7. BIN example/example.pdf
  8. +49 −0 example/r-references.bib
@@ -6,5 +6,4 @@
^cran-comments\.md$
^\.travis\.yml

^example/
^inst/images/
^example$
@@ -13,3 +13,4 @@ Thumbs.db
.RData
example/example_files
example/example.tex
inst/doc
95 NEWS.md
@@ -1,27 +1,89 @@
# Pre release
# papaja 0.1.0.9423

Template:
- Removed author field 'department' from the YAML header
- Added LaTeX fix for tightlist-bug in pandoc 1.14
- Fixed extra comma in automatically generated corresponding author line when no note is provided
- Fixed a bug causing a LaTeX error in `jou` mode (reported by @saladspices, #48)
- Default `lang` is now `english`; fixed a pandoc-citeproc bug (reported by @mvuorre and @sebastiansauer, #56 and #57; fixed by Matti Vuorre, #58)
- Removed `author` field `department`, information can be supplied as part of the `address` field
- New option `author_note`; `note` is used to add additional information to the title page
- Changed heading "Sample" to "Participants"
- Fixed bug that supplied CSL file was ignored
- Proper author name concatination on title page (reported by Ulf Mertens)
- LaTeX
- New options `figurelist` and `tablelist` to create lists of figure or table captions at the end of the document
- Added `upgreek` package
- Fixed bug causing `figsintext` to have no effect (reported by @mattsigal, #61)
- Added page break before reference section (reported by @mattsigal, #60)
- Word
- Fixed bug causing a deranged title page (reported by @mvuorre, #59)
- Figure captions are now preceded by "Figure."

Exisiting functions:
- `apa_barplot()`
- Fixed ignorance of user specified color for one factorial plots
- Fixed default ylim choice to consider the lower bound of confidence intervals
Existing functions:
- `apa_print()`
- Improved type setting of predictors in tables
- New supports `car::LeveneTest()` output
- Dropped redundant df-column in `apa_print.lm()` table
- Fixed bug causing the omission of R^2 confidence intervalls in `apa_print.lm()` when F-values were small
- Fixed bug in `apa_print.list()` causing an error with only two models
- Refactored `apa_print()`-family for ANOVA objects
- Only df corrected for nonsphericity are reported with two decimals
- Added indication of sphericity correction to `apa_print.Anova.mlm()` table
- `print_anova()` rounds effect size estimates to three decimals
- Can now calculate eta^2 effect sizes
- New option `intercept` determines if intercept tests are included in the output
- New option `mse` to report mean squared error terms (thanks to @TomHardwicke for reporting early bugs, #49)
- `apa_table()`
- Removed redundant `row_name` parameter
- Fixed escaped multicolumn-headings in `apa_table.latex()`

- Dropped redundant `row_names` option
- New option `stub_indents` adds title sections to indented rows
- Renamed option `added_colnames` to `added_stub_head`
- `apa_table.latex()`
- New option `col_spanners` to add column spanners
- New option `small` to decrease font size for large tables
- Improvements to long and landscape tables
- `apa_barplot()`
- Now works with white space in factor names
- Improvements to automatic setting of `ylim`
- Fixed bug that led to the incorrect drawing of user-specified colors
- Only one legend is drawn for multiple facets
- New option `args_arrows` to customize error bars
- Invisibly returns means and measures of dispersion
- `cite_r()`
- New options `pkgs` and `withhold` to black- or whitelist packages (#50)
- Output retains structure if footnote = TURE but no bib-file is found
- `r_refs()`
- Now handles packages with mulitple references (reported by mattsigal, #65)
- `conf_int()`
- Fixed bug that led to negative values

New functions:
- `apa_print.afex_aov()` (#47)
- `apa_print.list()` (#27)
- `wsci()`
- `apa_lineplot()`
- `apa_beeplot()` (thanks to @TobiasKoeln for reporting early bugs, #72)
- `theme_apa()`
- `render_appendix()`
- `fetch_zotero_refs()`
- `in_paren()`

Dropped functions:
- `fetch_web_refs()` evolved into a clone of `downloder::download()`
- `apa_prepare_doc()` is no longer needed

Misc:
- Fixed some typos in the example document
- papaja sets global options `papaja.mse` and `papaja.sphericity_correction` among others
- Updated example manuscript
- Added vignette


# papaja 0.1.0.9054

Template:
- Added `wordcount` parameter to YAML header
- Changed YAML header structure to support proper author and affiliation information (requires updates of existing Rmd-files)
- LaTeX: Changed SVG device to PS
- Removed author field 'department' from the YAML header
- Added LaTeX fix for tightlist-bug in pandoc 1.14
- Fixed extra comma in automatically generated corresponding author line when no note is provided

Existing functions:
- `apa_print()`
@@ -39,6 +101,12 @@ Existing functions:
- Creates proper references based on citation file if available instead of generating default references from description file
- `apa_prepare_doc()`
- Fixed bug when `lang` was not set in YAML header
- `apa_barplot()`
- Fixed ignorance of user specified color for one factorial plots
- Fixed default ylim choice to consider the lower bound of confidence intervals
- `apa_table()`
- Removed redundant `row_name` parameter
- Fixed escaped multicolumn-headings in `apa_table.latex()`

New functions:
- `apa_print.anova.mlm()`
@@ -49,7 +117,8 @@ New functions:
Misc:
- Set up proper package structure for automatic unit testing
- Created news file
- Fixed some typos in the example document

# papaja 0.1.0.9000

- Initial release
- Initial release on GitHub
@@ -40,7 +40,7 @@ devtools::install_github("crsh/papaja")


## How to use papaja
Once `papaja` is installed, you can select the APA template when creating a new Markdown file through the RStudio menues.
Once `papaja` is installed, you can select the APA template when creating a new Markdown file through the RStudio menus.

![APA template selection](inst/images/template_selection.png)

@@ -81,7 +81,8 @@ Table. *Iris regression table.*

---

Be sure to also check out `apa_barplot()` and `apa_beeplot()` if you work with factorial designs. If you prefer working with `ggplot2` try `theme_apa()`.
Be sure to also check out `apa_barplot()` and `apa_beeplot()` if you work with factorial designs.
If you prefer creating your plots with `ggplot2` try `theme_apa()`.

### Using papaja without RStudio
Don't use RStudio? No problem. Use the `rmarkdown::render` function to create articles:
@@ -102,8 +103,7 @@ rmarkdown::render("mymanuscript.Rmd")

## Known issues
- The references in Word violate the APA guidelines in that there is no hanging indentation (i.e. indentation of all lines but the first one). As of now there is no fix for this problem.
- Intext citation incorrectly use ampersands instead of "and". This is a current limitation of the [pandoc-citeproc](https://hackage.haskell.org/package/pandoc-citeproc) filter. I'm still looking for ways to fix this.
- If building the example manuscript throws the error `! Incomplete \iffalse; all text was ignored after line 20.` make sure you have saved the .Rmd and are not working from a temporary directory or restart RStudio. If this doesn't work try updating your TeX-packages.
- In-text citation incorrectly use ampersands instead of "and". This is a current limitation of the [pandoc-citeproc](https://hackage.haskell.org/package/pandoc-citeproc) filter. I'm still looking for ways to fix this.
- Citations may mess with RStudios syntax highlighting in the current line. Incorrect highlighting following a citation does not necessarily indicate incorrect syntax.
- Printing PDF from RStudio's PDF viewer can produce weird results. If you want to print your manuscript I suggest you use any other PDF viewer of your choice.

@@ -42,7 +42,7 @@ devtools::install_github("crsh/papaja")
How to use papaja
-----------------

Once `papaja` is installed, you can select the APA template when creating a new Markdown file through the RStudio menues.
Once `papaja` is installed, you can select the APA template when creating a new Markdown file through the RStudio menus.

![APA template selection](inst/images/template_selection.png)

@@ -80,7 +80,7 @@ Table. *Iris regression table.*

------------------------------------------------------------------------

Be sure to also check out `apa_barplot()` and `apa_beeplot()` if you work with factorial designs. If you prefer working with `ggplot2` try `theme_apa()`.
Be sure to also check out `apa_barplot()` and `apa_beeplot()` if you work with factorial designs. If you prefer creating your plots with `ggplot2` try `theme_apa()`.

### Using papaja without RStudio

@@ -104,8 +104,7 @@ Known issues
------------

- The references in Word violate the APA guidelines in that there is no hanging indentation (i.e. indentation of all lines but the first one). As of now there is no fix for this problem.
- Intext citation incorrectly use ampersands instead of "and". This is a current limitation of the [pandoc-citeproc](https://hackage.haskell.org/package/pandoc-citeproc) filter. I'm still looking for ways to fix this.
- If building the example manuscript throws the error `! Incomplete \iffalse; all text was ignored after line 20.` make sure you have saved the .Rmd and are not working from a temporary directory or restart RStudio. If this doesn't work try updating your TeX-packages.
- In-text citation incorrectly use ampersands instead of "and". This is a current limitation of the [pandoc-citeproc](https://hackage.haskell.org/package/pandoc-citeproc) filter. I'm still looking for ways to fix this.
- Citations may mess with RStudios syntax highlighting in the current line. Incorrect highlighting following a citation does not necessarily indicate incorrect syntax.
- Printing PDF from RStudio's PDF viewer can produce weird results. If you want to print your manuscript I suggest you use any other PDF viewer of your choice.

@@ -56,15 +56,14 @@ For *R* users, R Markdown has been suggested as one possible framework for repro
The package uses the \LaTeX document class [apa6](http://www.ctan.org/pkg/apa6) and a .docx-reference file, so you can create PDF documents, or Word documents if you have to.
Moreover, `papaja` supplies R-functions that facilitate reporting results of your analyses in accordance with APA guidelines.


Markdown is a simple formatting syntax that can be used to author HTML, PDF, and MS Word documents (among others).
In the following I will assume you have hopped onto the band wagon and know how to use R Markdown to conduct and comment your analyses.
If this is not the case, I recommend you get to grips with [R Markdown](http://R Markdown.rstudio.com/) first.
I use [RStudio](http://www.rstudio.com/) (which makes use of [pandoc](http://johnmacfarlane.net/pandoc/)) to create my documents, but the general process works using any other text editor.


# How to use papaja
Once you have installed `papaja` and all other [required software](https://github.com/crsh/papaja), you can select the APA template when creating a new Markdown file through the RStudio menues, see \autoref{fig:menu}.
Once you have installed `papaja` and all other [required software](https://github.com/crsh/papaja), you can select the APA template when creating a new Markdown file through the RStudio menus, see \autoref{fig:menu}.
When you click RStudio's *Knit* button (see \autoref{fig:knit}), `papaja`, `R Markdown,` and `knitr` work together to create an APA conform manuscript that includes both your text and the output of any embedded R code chunks within the manuscript.

![papaja's APA6 template is available through the RStudio menues. \label{fig:knit}](../inst/images/template_selection.png)
@@ -88,12 +87,13 @@ For prettier tables, I suggest you try `apa_table()`, which builds on `knitr`'s
```{r results = 'asis', echo = TRUE}
descriptives <- mixed_data %>% group_by(Dosage) %>%
summarize(
Mean = printnum( mean(Recall) )
, Median = printnum( median(Recall) )
, SD = printnum( sd(Recall) )
, Min = printnum( min(Recall) )
, Max = printnum( max(Recall) )
Mean = mean(Recall)
, Median = median(Recall)
, SD = sd(Recall)
, Min = min(Recall)
, Max = max(Recall)
)
descriptives[, -1] <- printnum(descriptives[, -1])
apa_table(
descriptives
@@ -111,7 +111,7 @@ In papaja, table formatting is somewhat limited for Word documents due to missin

[^xtable]: When you use `xtable()`, table captions are [set to the left page margin](http://tex.stackexchange.com/questions/42209/centering-tables-in-document-class-apa6).

As required by the APA guidelines, tables are defered to the final pages of the manuscript when creating a PDF.
As required by the APA guidelines, tables are deferred to the final pages of the manuscript when creating a PDF.
To place tables and figures in your text instead, set the `figsintext` parameter in the YAML header to `yes` or `true`, as I have done in this document.
Again, this is not the case in Word documents due to limited pandoc functionality.
The bottom line is, Word documents will be less polished than PDF.
@@ -120,7 +120,7 @@ The resulting documents should suffice to enable collaboration with Wordy collea
### Embed plots
As usual in R Markdown, you can embed R-generated plots into your document, see \autoref{fig:bee}.

```{r fig.cap = "Bee plot of the example data set. Small points represent individual observations, large points represent means, and error bars represent 95% confidence intervals. \\label{fig:bee}", echo = TRUE}
```{r fig.cap = "Bee plot of the example data set. Small points represent individual observations, large points represent means, and error bars represent 95% confidence intervals. \\label{fig:bee}", echo = TRUE, dev.args = list(bg = 'white')}
apa_beeplot(
mixed_data
, id = "Subject"
@@ -129,10 +129,12 @@ apa_beeplot(
, dispersion = conf_int
, ylim = c(0, 30)
, las = 1
, args_points = list(cex = 1.5)
, args_arrows = list(length = 0.025)
)
```

Again, as required by the APA guidelines, figures are defered to the final pages of the document unless you set `figsintext` to `yes`.
Again, as required by the APA guidelines, figures are deferred to the final pages of the document unless you set `figsintext` to `yes`.

### Referencing figures and tables
Currently, `rmarkdown` does not support proper cross-referencing with the document.
@@ -180,7 +182,7 @@ apa_table(
## Citations
No manuscript is complete without citation.
In order for citations to work, you need to supply a .bib-file to the `bibliography` parameter in the YAML front matter.
Once this is done, `[e.g., @james_1890; @bem_2011]` produces a regular citation within parenthes [e.g., @james_1890; @bem_2011].
Once this is done, `[e.g., @james_1890; @bem_2011]` produces a regular citation within parentheses [e.g., @james_1890; @bem_2011].
To cite a source in text simply omit the brackets; for example, write `@james_1890` to cite @james_1890.
For other options see the [overview of the R Markdown citation syntax](http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html).
If you use RStudio, I have created an [easy-to-use add-in](https://github.com/crsh/citr) that facilitates inserting citations.
BIN +2.32 KB (100%) example/example.pdf
Binary file not shown.
@@ -70,3 +70,52 @@ @Article{R-reshape2
pages = {1--20},
url = {http://www.jstatsoft.org/v21/i12/},
}
@Article{R-testthat,
author = {Hadley Wickham},
title = {testthat: Get Started with Testing},
journal = {The R Journal},
year = {2011},
volume = {3},
pages = {5--10},
url = {http://journal.r-project.org/archive/2011-1/RJournal_2011-1_Wickham.pdf},
}
@Book{R-boot,
title = {Bootstrap Methods and Their Applications},
author = {A. C. Davison and D. V. Hinkley},
publisher = {Cambridge University Press},
address = {Cambridge},
year = {1997},
note = {ISBN 0-521-57391-2},
url = {http://statwww.epfl.ch/davison/BMA/},
}
@Manual{R-broom,
title = {broom: Convert Statistical Analysis Objects into Tidy Data Frames},
author = {David Robinson},
year = {2016},
note = {R package version 0.4.1},
url = {https://CRAN.R-project.org/package=broom},
}
@Book{R-knitr,
title = {Dynamic Documents with {R} and knitr},
author = {Yihui Xie},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2015},
edition = {2nd},
note = {ISBN 978-1498716963},
url = {http://yihui.name/knitr/},
}
@Manual{R-MBESS,
title = {MBESS: The MBESS R Package},
author = {Ken Kelley},
year = {2016},
note = {R package version 4.0.0},
url = {https://CRAN.R-project.org/package=MBESS},
}
@Manual{R-rmarkdown,
title = {rmarkdown: Dynamic Documents for R},
author = {JJ Allaire and Joe Cheng and Yihui Xie and Jonathan McPherson and Winston Chang and Jeff Allen and Hadley Wickham and Aron Atkins and Rob Hyndman},
year = {2016},
note = {R package version 1.0},
url = {https://CRAN.R-project.org/package=rmarkdown},
}

0 comments on commit 3df2f19

Please sign in to comment.
You can’t perform that action at this time.