File: example.qmd.html

package info (click to toggle)
kf6-syntax-highlighting 6.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,200 kB
  • sloc: xml: 210,435; cpp: 12,977; python: 3,281; sh: 965; perl: 813; ruby: 494; pascal: 393; javascript: 161; php: 159; haskell: 141; jsp: 132; lisp: 131; ada: 119; ansic: 107; makefile: 96; f90: 94; ml: 85; cobol: 81; yacc: 71; csh: 62; exp: 61; erlang: 54; sql: 51; java: 47; sed: 45; objc: 37; tcl: 36; awk: 31; asm: 30; fortran: 18; cs: 10
file content (103 lines) | stat: -rw-r--r-- 9,070 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>example.qmd</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Quarto) - Theme (Breeze Light)"/>
</head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
---
<span style="color:#644a9b;font-weight:bold">title</span><span style="font-weight:bold">:</span><span style="color:#0057ae"> </span><span style="color:#bf0303">"Hello, Quarto"</span>
<span style="color:#644a9b;font-weight:bold">format</span><span style="font-weight:bold">:</span><span style="color:#0057ae"> html</span>
<span style="color:#644a9b;font-weight:bold">editor</span><span style="font-weight:bold">:</span><span style="color:#0057ae"> visual</span>
---

<span style="color:#0057ae;background-color:#e0e9f8">```{r}</span>
<span style="color:#898887">#| label: load-packages</span>
<span style="color:#898887">#| include: false</span>

<span style="color:#644a9b">library</span>(tidyverse)
<span style="color:#644a9b">library</span>(palmerpenguins)
<span style="color:#0057ae;background-color:#e0e9f8">```</span>

<span style="color:#644a9b;font-weight:bold">## This example</span>

This example code mostly from the Quatro guide: <span style="text-decoration:underline">https://quarto.org/docs/guide/</span> . GPL-2.

Quarto is very similar to R markdown, but also allows (inline) code blocks in Python, Julia, and Observable JS.

<span style="color:#644a9b;font-weight:bold">## Meet Quarto</span>

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <span style="color:#006e28">&lt;</span><span style="color:#006e28;text-decoration:underline">https://quarto.org</span><span style="color:#006e28">></span>.

<span style="color:#644a9b;font-weight:bold">## Meet the penguins</span>

<span style="color:#bf0303;background-color:#f7e6e6">![](</span><span style="color:#bf0303;background-color:#f7e6e6;text-decoration:underline">https://raw.githubusercontent.com/quarto-dev/quarto-web/main/docs/get-started/hello/rstudio/lter_penguins.png</span><span style="color:#bf0303;background-color:#f7e6e6">)</span>{style="float:right;" fig-alt="Illustration of three species of Palmer Archipelago penguins: Chinstrap, Gentoo, and Adelie. Artwork by @allison_horst." width="401"}

The <span style="color:#b08000">`penguins`</span> data from the <span style="color:#898887">[</span><span style="color:#006e28;text-decoration:underline">**palmerpenguins**</span><span style="color:#898887">](</span><span style="color:#898887;text-decoration:underline">https://allisonhorst.github.io/palmerpenguins</span><span style="color:#898887"> "palmerpenguins R package")</span> package contains size measurements for <span style="color:#0057ae;background-color:#e0e9f8">`{r}</span> <span style="color:#644a9b">nrow</span>(penguins)<span style="color:#0057ae;background-color:#e0e9f8">`</span> penguins from three species observed on three islands in the Palmer Archipelago, Antarctica.

The plot below shows the relationship between flipper and bill lengths of these penguins.

<span style="color:#0057ae;background-color:#e0e9f8">```{r}</span>
<span style="color:#898887">#| label: plot-penguins</span>
<span style="color:#898887">#| warning: false</span>
<span style="color:#898887">#| echo: false</span>
<span style="color:#898887"># </span><span style="color:#81ca2d;background-color:#f7e6e6;font-weight:bold">NOTE</span><span style="color:#898887">: We may want to add some sort of ighlighting for the above rendering options</span>

<span style="color:#644a9b">ggplot</span>(penguins, 
       <span style="color:#644a9b">aes</span>(<span style="color:#0057ae">x =</span> flipper_length_mm, <span style="color:#0057ae">y =</span> bill_length_mm)) <span style="color:#3daee9">+</span>
  <span style="color:#644a9b">geom_point</span>(<span style="color:#644a9b">aes</span>(<span style="color:#0057ae">color =</span> species, <span style="color:#0057ae">shape =</span> species)) <span style="color:#3daee9">+</span>
  <span style="color:#644a9b">scale_color_manual</span>(<span style="color:#0057ae">values =</span> <span style="color:#644a9b">c</span>(<span style="color:#bf0303">"darkorange"</span>,<span style="color:#bf0303">"purple"</span>,<span style="color:#bf0303">"cyan4"</span>)) <span style="color:#3daee9">+</span>
  <span style="color:#644a9b">labs</span>(
    <span style="color:#0057ae">title =</span> <span style="color:#bf0303">"Flipper and bill length"</span>,
    <span style="color:#0057ae">subtitle =</span> <span style="color:#bf0303">"Dimensions for penguins at Palmer Station LTER"</span>,
    <span style="color:#0057ae">x =</span> <span style="color:#bf0303">"Flipper length (mm)"</span>, <span style="color:#0057ae">y =</span> <span style="color:#bf0303">"Bill length (mm)"</span>,
    <span style="color:#0057ae">color =</span> <span style="color:#bf0303">"Penguin species"</span>, <span style="color:#0057ae">shape =</span> <span style="color:#bf0303">"Penguin species"</span>
  ) <span style="color:#3daee9">+</span>
  <span style="color:#644a9b">theme_minimal</span>()
<span style="color:#0057ae;background-color:#e0e9f8">```</span>


<span style="color:#0057ae;background-color:#e0e9f8">```{python}</span>
<span style="color:#898887">#| label: fig-polar</span>
<span style="color:#898887">#| fig-cap: "A line plot on a polar axis"</span>

<span style="color:#ff5500">import</span> numpy <span style="color:#ff5500">as</span> np
<span style="color:#ff5500">import</span> matplotlib.pyplot <span style="color:#ff5500">as</span> plt

r <span style="color:#ca60ca">=</span> np.arange(<span style="color:#b08000">0</span>, <span style="color:#b08000">2</span>, <span style="color:#b08000">0.01</span>)
theta <span style="color:#ca60ca">=</span> <span style="color:#b08000">2</span> <span style="color:#ca60ca">*</span> np.pi <span style="color:#ca60ca">*</span> r
fig, ax <span style="color:#ca60ca">=</span> plt.subplots(
  subplot_kw <span style="color:#ca60ca">=</span> {<span style="color:#bf0303">'</span><span style="color:#bf0303">projection</span><span style="color:#bf0303">'</span>: <span style="color:#bf0303">'</span><span style="color:#bf0303">polar</span><span style="color:#bf0303">'</span>} 
)
ax.plot(theta, r)
ax.set_rticks([<span style="color:#b08000">0.5</span>, <span style="color:#b08000">1</span>, <span style="color:#b08000">1.5</span>, <span style="color:#b08000">2</span>])
ax.grid(<span style="color:#0057ae">True</span>)
plt.show()
<span style="color:#0057ae;background-color:#e0e9f8">```</span>

<span style="color:#0057ae;background-color:#e0e9f8">```{julia}</span>
<span style="color:#898887">#| label: fig-parametric</span>
<span style="color:#898887">#| fig-cap: "Parametric Plots"</span>

<span style="color:#ff5500">using</span> <span style="color:#644a9b;font-weight:bold">Plots</span>

<span style="color:#644a9b">plot</span>(sin, 
     <span style="color:#644a9b">x->sin</span>(<span style="color:#b08000">2</span>x), 
     <span style="color:#b08000">0</span>, 
     <span style="color:#b08000">2</span>π, 
     leg<span style="color:#ca60ca">=</span><span style="color:#aa5500">false</span>, 
     fill<span style="color:#ca60ca">=</span>(<span style="color:#b08000">0</span>,<span style="color:#ca60ca">:</span>lavender))
<span style="color:#0057ae;background-color:#e0e9f8">```</span>

<span style="color:#0057ae;background-color:#e0e9f8">```{ojs}</span>
viewof bill_length_min <span style="color:#ca60ca">=</span> Inputs<span style="color:#ca60ca">.</span><span style="color:#644a9b">range</span>(
  [<span style="color:#b08000">32</span><span style="color:#ca60ca">,</span> <span style="color:#b08000">50</span>]<span style="color:#ca60ca">,</span> 
  {<span style="color:#0057ae">value</span><span style="color:#ca60ca">:</span> <span style="color:#b08000">35</span><span style="color:#ca60ca">,</span> <span style="color:#0057ae">step</span><span style="color:#ca60ca">:</span> <span style="color:#b08000">1</span><span style="color:#ca60ca">,</span> <span style="color:#0057ae">label</span><span style="color:#ca60ca">:</span> <span style="color:#bf0303">"Bill length (min):"</span>}
)
viewof islands <span style="color:#ca60ca">=</span> Inputs<span style="color:#ca60ca">.</span><span style="color:#644a9b">checkbox</span>(
  [<span style="color:#bf0303">"Torgersen"</span><span style="color:#ca60ca">,</span> <span style="color:#bf0303">"Biscoe"</span><span style="color:#ca60ca">,</span> <span style="color:#bf0303">"Dream"</span>]<span style="color:#ca60ca">,</span> 
  { <span style="color:#0057ae">value</span><span style="color:#ca60ca">:</span> [<span style="color:#bf0303">"Torgersen"</span><span style="color:#ca60ca">,</span> <span style="color:#bf0303">"Biscoe"</span>]<span style="color:#ca60ca">,</span> 
    <span style="color:#0057ae">label</span><span style="color:#ca60ca">:</span> <span style="color:#bf0303">"Islands:"</span>
  }
)
<span style="color:#0057ae;background-color:#e0e9f8">```</span>
</pre></body></html>