::metadata$output %>%
rmarkdownpluck(1, "highlight")
1] "themes/arrow-pandoc.theme" [
::metadata$output %>%
rmarkdownpluck(1, "highlight_downlit")
1] FALSE [
gitbook(fig_caption = TRUE, number_sections = TRUE,
self_contained = FALSE, lib_dir = "libs",
pandoc_args = NULL, ..., template = "default",
split_by = c("chapter", "chapter+number", "section", "section+number", "rmd", "none"),
split_bib = TRUE, config = list(), table_css = TRUE)
<- fluidPage(
ui fileInput("upload", NULL, buttonLabel = "Upload...", multiple = TRUE),
tableOutput("files")
)<- function(input, output, session) {
server $files <- renderTable(input$upload)
output }
<- function(input, output, session) {
server <- reactive(seq(0, input$length, length = input$length * 100))
t <- reactive(sin(input$omega * t() + input$delta) * input$damping ^ t())
x <- reactive(sin(t()) * input$damping ^ t())
y
$fig <- renderPlot({
outputplot(x(), y(), axes = FALSE, xlab = "", ylab = "", type = "l", lwd = 2)
res = 96)
},
observe({
reactiveValuesToList(input)
$doBookmark()
session
})onBookmarked(updateQueryString)
}
---
title: "Distill for R Markdown"
description: |
Scientific and technical writing, native to the weboutput:
distill::distill_article:
toc: true
toc_depth: 2
---
library(palmerpenguins)
library(tidyverse)
%>%
penguins ::filter(year == 2007 & species == "Gentoo") %>%
dplyr::summarise(mean_fl = mean(flipper_length_mm, na.rm = TRUE))
dplyr# A tibble: 1 x 1
mean_fl<dbl>
1 215.
glimpse(penguins)
: 344
Rows: 8
Columns$ species <fct> Adelie, Adelie, Adelie, Adelie, Adelie, Ad…
$ island <fct> Torgersen, Torgersen, Torgersen, Torgersen…
$ bill_length_mm <dbl> 39.1, 39.5, 40.3, NA, 36.7, 39.3, 38.9, 39…
$ bill_depth_mm <dbl> 18.7, 17.4, 18.0, NA, 19.3, 20.6, 17.8, 19…
$ flipper_length_mm <int> 181, 186, 195, NA, 193, 190, 181, 195, 193…
$ body_mass_g <int> 3750, 3800, 3250, NA, 3450, 3650, 3625, 46…
$ sex <fct> male, female, female, NA, female, male, fe…
$ year <int> 2007, 2007, 2007, 2007, 2007, 2007, 2007, …
# Histogram example: flipper length by species
ggplot(data = penguins, aes(x = flipper_length_mm)) +
geom_histogram(aes(fill = species), alpha = 0.5, position = "identity") +
scale_fill_manual(values = c("darkorange","darkorchid","cyan4"))
<- ggplot(data = penguins,
mass_flipper aes(x = flipper_length_mm,
y = body_mass_g)) +
geom_point(aes(color = species,
shape = species),
size = 3,
alpha = 0.8) +
theme_minimal() +
scale_color_manual(values = c("darkorange","purple","cyan4")) +
labs(title = "Penguin size, Palmer Station LTER",
subtitle = "Flipper length and body mass for Adelie, Chinstrap and Gentoo Penguins",
x = "Flipper length (mm)",
y = "Body mass (g)",
color = "Penguin species",
shape = "Penguin species") +
theme(legend.position = c(0.2, 0.7),
legend.background = element_rect(fill = "white", color = NA),
plot.title.position = "plot",
plot.caption = element_text(hjust = 0, face= "italic"),
plot.caption.position = "plot")
mass_flipper