Skip to content

Commit

Permalink
Laste metadata tweaks before submission.
Browse files Browse the repository at this point in the history
- Shortend package title
- Renamed cran_comments.md to cran-comments.md
- Removed Maintainer line from DESCRIPTION
- Removed README and NEWS from .Rbuildignore
- Added example to cos_prereg() documentation
- Created package documentation
  • Loading branch information
crsh committed Feb 16, 2016
1 parent 8fdcfbb commit 7326967
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 29 deletions.
5 changes: 1 addition & 4 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
^\.Rproj\.user$

.travis.yml
cran_comments.md

README.md
NEWS.md
cran-comments.md
8 changes: 3 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
Package: prereg
Type: Package
Title: An RMarkdown Template that Facilitates Authoring Preregistrations of
Scientific Studies
Title: R Markdown Template to Preregister Scientific Studies
Version: 0.1.0
Date: 2016-2-15
Authors@R: c(person("Frederik", "Aust", email = "[email protected]", role = c("aut", "cre")))
Maintainer: "Frederik Aust" <[email protected]>
Description: The RMarkdown template in the prereg package is based on the Center
Description: The R Markdown template in this package is based on the Center
for Open Science Preregistration Challenge and is, thus, particularly suited to
draft preregistrations that enter the challenge.
draft preregistration documents for studies that enter the challenge.
URL: https://github.com/crsh/prereg
BugReports: https://github.com/crsh/prereg/issues
Depends:
Expand Down
23 changes: 19 additions & 4 deletions R/cos_prereg.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
#' Knit a PDF document using the COS Preregistration Challenge template
#'
#' @param ... additional arguments to \code{\link[rmarkdown]{pdf_document}}; \code{template} is ignored.
#' @examples
#' \dontrun{
#' # Create R Markdown file
#' rmarkdown::draft(
#' "my_preregistration.Rmd"
#' , "cos_prereg"
#' , package = "prereg"
#' , create_dir = FALSE
#' , edit = FALSE
#' )
#'
#' # Render file
#' rmarkdown::render("my_preregistration.Rmd")
#' }
#'
#' @export

cos_prereg <- function(...) {
Expand All @@ -19,20 +34,20 @@ cos_prereg <- function(...) {

# Create format
cos_prereg_format <- do.call(rmarkdown::pdf_document, ellipsis)

## Overwrite preprocessor to set correct margin and CSL defaults
saved_files_dir <- NULL

# Preprocessor functions are adaptations from the RMarkdown package
# (https://github.com/rstudio/rmarkdown/blob/master/R/pdf_document.R)
# to ensure right geometry defaults in the absence of user specified values
pre_processor <- function(metadata, input_file, runtime, knit_meta, files_dir, output_dir) {
# save files dir (for generating intermediates)
saved_files_dir <<- files_dir

pdf_pre_processor(metadata, input_file, runtime, knit_meta, files_dir, output_dir)
}

cos_prereg_format$pre_processor <- pre_processor

cos_prereg_format
Expand Down
28 changes: 28 additions & 0 deletions R/prereg.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#' R Markdown Template for Preregistrations of Scientific Studies
#'
#' The \href{http://rmarkdown.rstudio.com/}{R Markdown} template in the prereg package is based
#' on the \href{https://cos.io/prereg/}{Center for Open Science Preregistration Challenge} and
#' is, thus, particularly suited to draft preregistrations that enter the challenge.
#' @section System requirements:
#' Before using \pkg{prereg} to create a preregistration document, make sure the following
#' software is installed on your computer:
#'
#' \itemize{
#' \item{\href{http://www.rstudio.com/}{RStudio} (>= 0.98.932); if you don't use RStudio
#' , you need to install \href{http://johnmacfarlane.net/pandoc/}{pandoc} using the
#' \href{https://github.com/rstudio/rmarkdown/blob/master/PANDOC.md}{instructions for your operating system}}
#' \item{A \href{http://de.wikipedia.org/wiki/TeX}{TeX} distribution (2013 or later; e.g., \href{http://miktex.org/}{MikTeX}
#' for Windows, \href{https://tug.org/mactex/}{MacTeX} for Mac, obviously, or \href{http://www.tug.org/texlive/}{TeX Live}
#' for Linux)}
#' }
#'
#' If you are running \emph{Windows}, use MikTex if possible. Currently, pandoc and the Windows version of Tex Live
#' \href{https://github.com/rstudio/rmarkdown/issues/6}{don't seem to like each other}. Make sure you install the
#' \emph{complete}---not the basic---version.
#'
#' @section Author and Maintainer:
#' Frederik Aust (frederik.aust at uni-koeln.de).
#' @docType package
#' @name prereg

NULL
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# prereg: Preregister scientific studies using RMarkdown
# prereg: R Markdown Template for Preregistrations of Scientific Studies

[![Build Status](https://travis-ci.org/crsh/prereg.svg?branch=master)](https://travis-ci.org/crsh/prereg)

`prereg` provides an [RMarkdown](http://rmarkdown.rstudio.com/) template that facilitates authoring preregistrations of scientific studies in PDF format. The template is based on the [Center for Open Science Preregistration Challenge](https://cos.io/prereg/) template and is, thus, particularly suited to draft preregistrations that enter the challenge.
`prereg` provides an [R Markdown](http://rmarkdown.rstudio.com/) template that facilitates authoring preregistrations of scientific studies in PDF format. The template is based on the [Center for Open Science Preregistration Challenge](https://cos.io/prereg/) template and is, thus, particularly suited to draft preregistrations that enter the challenge.

If you experience any problems, please [open an issue](https://github.com/crsh/prereg/issues).

## Setup
### Requirements
To use RMarkdown and `prereg` you need the following software on your computer:
To use R Markdown and `prereg` you need the following software on your computer:

- [R](http://www.r-project.org/) (2.11.1 or later)
- [RStudio](http://www.rstudio.com/) (0.99.441 or later) is optional; if you don't use RStudio, you need to install [pandoc](http://johnmacfarlane.net/pandoc/) using the [instructions for your operating system](https://github.com/rstudio/rmarkdown/blob/master/PANDOC.md)
Expand All @@ -24,7 +24,7 @@ devtools::install_github("crsh/prereg")
```

### Create a preregistration document
Once you have installed the `prereg` you can select the template when creating a new RMarkdown file through the RStudio menus.
Once you have installed the `prereg` you can select the template when creating a new R Markdown file through the RStudio menus.

<center>
![](https://www.dropbox.com/s/y39lywyloypuncb/template_selection.png?dl=1)
Expand Down
27 changes: 27 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Test environments
* local OS X 10.11 install, R 3.2.3
* local Ubuntu 14.04 install, R 3.2.3
* Ubuntu 12.04 (on travis-ci), R 3.2.3
* win-builder (devel and release)

## R CMD check results
There were no ERRORs and WARNINGs.

There was 1 NOTE:

* Maintainer: 'Frederik Aust <[email protected]>'
New submission

## Downstream dependencies
This is the first submission of prereg; there are no downstream
dependencies.

## Resubmission
This is a resubmission. In this version I have:

* Removed 'prereg' and 'preregistrations' from DESCRIPTION
(sorry for the confusion)
* Added example and package documentation (?prereg)
* Changed the term 'RMarkdown' in DESCRIPTION to 'R Markdown'
in accordance with the spelling used in, e.g., the rmarkdown
package
12 changes: 0 additions & 12 deletions cran_comments.md

This file was deleted.

16 changes: 16 additions & 0 deletions man/cos_prereg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions man/prereg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7326967

Please sign in to comment.