Giter Club home page Giter Club logo

rmd_template's Introduction

R markdown template for scientific papers

This template and example include:

  • Common order for scientific papers (i.e., main text, references, tables and figures).
  • Page breaks for both word and pdf documents
  • Table and figure captions for main text and supporting information.

r page_break() will add page break for word and pdf documents. r page_break("Figures") will add page break and a new page starts with section "Figures".

References:

Rendering

# rendering to PDF
render("main_text.rmd", "bookdown::pdf_document2")

# rendering to docx
render("main_text.rmd", "bookdown::word_document2")

Example for main text

library(methods)
library(knitr)
library(kableExtra)
library(png)
library(grid)
library(pander)
source("rmd_func.r")

Title: Title of your manuscript

$$ $$

First Author^1,2^ Second Author^2^, and Third Author^3^

$$ $$

^1^ First Affiliation

^2^ Second Affiliation

^3^ Third Affiliation

r page_break("Abstract")

Your abstract.

Introduction

Your introduction [@Wright2004a]. Some more text [@Kraft2008]. More text [@Hubbell2001].

Material and Methods

Your Material and Methods. We fitted XXXX:

\begin{equation} N_{ij} \sim NB(\mu_{ij}, \phi) (#eq:NB) \end{equation}

where $\mu_{ij}$ is xxxxxx, xxxxxxxx,

\begin{equation} \mu_{ij} \times v_i = exp(\Sigma \beta_{jk} z_{ik}) (#eq:mu) \end{equation}

where $\beta_{jk}$ is xxxxxx. Prior for $\phi$ in Eq. @ref(eq:NB) was specified as xxxxx.

We found XXX (Fig. @ref(fig:scatplt) and Table @ref(tab:tblm)). We also found xxx (Fig. @ref(fig:boxplt)) yay!

Discussion

Some texts.

References

r page_break()

Table: (#tab:tblm). Summary of the regression model.

fit <- lm(mpg ~ wt * cyl, data = mtcars)
tb1 <- pander(fit, caption = "")
tb1

r page_break()

tb2 <- head(mtcars)
kable(tb2, caption = "Some datasets.")

r page_break("Figures")


img <- readPNG("scat.png", native = TRUE, info = TRUE)
grid.raster(img, interpolate=F)

r page_break()


img <- readPNG("boxp.png", native = TRUE, info = TRUE)
grid.raster(img, interpolate=F)

Example for Supporting information

Supporting Information

knitr::kable(mtcars)

r page_break()

grid.raster(img, interpolate=F)

rmd_template's People

Contributors

mattocci27 avatar

Watchers

James Cloos avatar  avatar

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.