rmarkdown

repository·main·Indexed 25 days ago

https://github.com/rstudio/rmarkdown

An R package for creating dynamic analysis documents that integrate code, rendered output, and prose. It supports producing reports in HTML, PDF, Word, and slideshow formats, utilizing Pandoc for rendering.

Tokens
431
Snippets
1
Records
2
Agent score
35%

What's inside rmarkdown

  1. Create and render R Markdown documents

    main

    R Markdown documents (.Rmd) combine code, rendered output, and prose. They can be rendered to HTML, PDF, Word, or slideshows.

    Using RStudio IDE

    1. Creation: Navigate to File > New File > R Markdown. Follow the wizard to set a title, author, and output format (HTML is recommended).
    2. Rendering: Click the Knit button in the IDE or use the keyboard shortcut Cmd/Ctrl + Shift + K to render the file and preview the output.

    Manual Authoring

    You can create a .Rmd file by writing Markdown prose and inserting code chunks:

    • Insert Code Chunk: Use the keyboard shortcut Ctrl + Alt + I (Windows/Linux) or Cmd + Option + I (macOS).
    • Run Chunks: Click the run icon within the code chunk in RStudio to execute code interactively.
    • Full Render: Use the "Knit to HTML" (or other format) command to execute all chunks and generate the final document.
  2. Install the rmarkdown package

    main

    You can install rmarkdown using several methods depending on your environment:

    1. RStudio IDE: No explicit installation is required; RStudio automatically installs and loads it when needed.
    2. CRAN (Standard R installation): Use install.packages() if working outside of RStudio.
    3. GitHub (Development version): Use the pak package to install the latest development version from GitHub.

    Note: If you are not using the RStudio IDE, you must manually install a recent version of Pandoc (>= 1.12.3).

    # Standard CRAN installation
    install.packages("rmarkdown")
    
    # Development version via pak
    # install.packages("pak")
    pak::pak('rstudio/rmarkdown')