Skip to content

Commit ab7e3b8

Browse files
committed
commits
1 parent 95f8af5 commit ab7e3b8

File tree

7 files changed

+819
-55
lines changed

7 files changed

+819
-55
lines changed

.github/workflows/publish.yml

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
name: Quarto Publish
21
on:
32
workflow_dispatch:
43
push:
54
branches:
65
- main
6+
pull:
7+
branches:
8+
- main
9+
10+
name: Quarto Publish
11+
712
jobs:
8-
build-deploy:
13+
publish:
914
runs-on: ubuntu-latest
10-
permissions:
11-
contents: write
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1217
steps:
13-
- name: Check out repository
14-
uses: actions/checkout@v4
15-
- name: Set up Quarto
16-
uses: quarto-dev/quarto-actions/setup@v2
17-
- name: Render and Publish
18-
uses: quarto-dev/quarto-actions/publish@v2
18+
- uses: actions/checkout@v4
19+
20+
- uses: r-lib/actions/setup-r@v2
21+
- uses: r-lib/actions/setup-r-dependencies@v2
22+
- uses: quarto-dev/quarto-actions/setup@v2
23+
24+
- uses: quarto-dev/quarto-actions/render@v2
25+
26+
- name: Deploy to GitHub pages 🚀
27+
uses: JamesIves/github-pages-deploy-action@v4.5.0
1928
with:
20-
target: gh-pages
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
branch: gh-pages
30+
folder: _site

_site/content/ons_nomis.html

+703
Large diffs are not rendered by default.
Loading

_site/index.html

+31-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
88

99

10-
<title>rforhta</title>
10+
<title>R for Health Technology Assesment – rforhta</title>
1111
<style>
1212
code{white-space: pre-wrap;}
1313
span.smallcaps{font-variant: small-caps;}
@@ -181,7 +181,7 @@
181181

182182
<header id="title-block-header" class="quarto-title-block default">
183183
<div class="quarto-title">
184-
<h1 class="title">rforhta</h1>
184+
<h1 class="title">R for Health Technology Assesment</h1>
185185
</div>
186186

187187

@@ -199,13 +199,42 @@ <h1 class="title">rforhta</h1>
199199

200200

201201
<p>This is a Quarto website.</p>
202+
<p>Quarto allows us to display code and its output</p>
202203
<p>To learn more about Quarto websites visit <a href="https://quarto.org/docs/websites" class="uri">https://quarto.org/docs/websites</a>.</p>
203204
<div class="cell">
204205
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="dv">1</span> <span class="sc">+</span> <span class="dv">1</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
205206
<div class="cell-output cell-output-stdout">
206207
<pre><code>[1] 2</code></pre>
207208
</div>
208209
</div>
210+
<p>which wont tell automatically install the package if it is not installed for us.</p>
211+
<p>An example is how to plot some data, fitted with a linear model and coloured by group</p>
212+
<div class="cell">
213+
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(</span>
214+
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="at">data =</span> penguins,</span>
215+
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">x =</span> flipper_length_mm, <span class="at">y =</span> body_mass_g)</span>
216+
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>) <span class="sc">+</span></span>
217+
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_point</span>(<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">color =</span> species)) <span class="sc">+</span></span>
218+
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_smooth</span>(<span class="at">method =</span> <span class="st">"lm"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
219+
<div class="cell-output cell-output-stderr">
220+
<pre><code>`geom_smooth()` using formula = 'y ~ x'</code></pre>
221+
</div>
222+
<div class="cell-output cell-output-stderr">
223+
<pre><code>Warning: Removed 2 rows containing non-finite outside the scale range
224+
(`stat_smooth()`).</code></pre>
225+
</div>
226+
<div class="cell-output cell-output-stderr">
227+
<pre><code>Warning: Removed 2 rows containing missing values or values outside the scale range
228+
(`geom_point()`).</code></pre>
229+
</div>
230+
<div class="cell-output-display">
231+
<div>
232+
<figure class="figure">
233+
<p><img src="index_files/figure-html/unnamed-chunk-3-1.png" class="img-fluid figure-img" width="672"></p>
234+
</figure>
235+
</div>
236+
</div>
237+
</div>
209238

210239

211240

Loading

_site/search.json

+45-38
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,52 @@
22
{
33
"objectID": "index.html",
44
"href": "index.html",
5-
"title": "rforhta",
5+
"title": "R for Health Technology Assesment",
66
"section": "",
7-
"text": "This is a Quarto website.\nTo learn more about Quarto websites visit https://quarto.org/docs/websites.\n\n1 + 1\n\n[1] 2",
7+
"text": "This is a Quarto website.\nQuarto allows us to display code and its output\nTo learn more about Quarto websites visit https://quarto.org/docs/websites.\n\n1 + 1\n\n[1] 2\n\n\nwhich wont tell automatically install the package if it is not installed for us.\nAn example is how to plot some data, fitted with a linear model and coloured by group\n\nggplot(\n data = penguins,\n mapping = aes(x = flipper_length_mm, y = body_mass_g)\n) +\n geom_point(mapping = aes(color = species)) +\n geom_smooth(method = \"lm\")\n\n`geom_smooth()` using formula = 'y ~ x'\n\n\nWarning: Removed 2 rows containing non-finite outside the scale range\n(`stat_smooth()`).\n\n\nWarning: Removed 2 rows containing missing values or values outside the scale range\n(`geom_point()`).",
88
"crumbs": [
99
"Home"
1010
]
1111
},
12+
{
13+
"objectID": "content/basicr.html",
14+
"href": "content/basicr.html",
15+
"title": "Base R",
16+
"section": "",
17+
"text": "this is your introduction to base R"
18+
},
19+
{
20+
"objectID": "content/basicr.html#introduction",
21+
"href": "content/basicr.html#introduction",
22+
"title": "Base R",
23+
"section": "",
24+
"text": "this is your introduction to base R"
25+
},
26+
{
27+
"objectID": "content/basicr.html#base-r",
28+
"href": "content/basicr.html#base-r",
29+
"title": "Base R",
30+
"section": "Base R",
31+
"text": "Base R"
32+
},
33+
{
34+
"objectID": "content/basicr.html#before-r-there-was",
35+
"href": "content/basicr.html#before-r-there-was",
36+
"title": "Base R",
37+
"section": "Before R there was?",
38+
"text": "Before R there was?"
39+
},
40+
{
41+
"objectID": "content/git.html",
42+
"href": "content/git.html",
43+
"title": "git and github",
44+
"section": "",
45+
"text": "git is a difficult but extremely helpful tool for those of us that work with data.\ngit is a tool that tracks changes to your files and enables you to share those changes with others.\nThese git configured set of files are called repositories or repos and are organised in a structured way.\nA rather large caveat is that:\n\nit is very much not advised to store data in these projects on git\nwhen working in groups, it is best to store data elsewhere and have scripts that interact with your local copy of the data\n\nIn my work, i use git to store text based code as a backup in case i make breaking changes to my analytical workflow that result in different results / different subsets of data etc.\nabcdefg",
46+
"crumbs": [
47+
"Basics",
48+
"Git Basics"
49+
]
50+
},
1251
{
1352
"objectID": "content/installr.html",
1453
"href": "content/installr.html",
@@ -43,42 +82,10 @@
4382
]
4483
},
4584
{
46-
"objectID": "content/git.html",
47-
"href": "content/git.html",
48-
"title": "git and github",
85+
"objectID": "content/ons_nomis.html",
86+
"href": "content/ons_nomis.html",
87+
"title": "ONS NOMIS",
4988
"section": "",
50-
"text": "git is a difficult but extremely helpful tool for those of us that work with data.\ngit is a tool that tracks changes to your files and enables you to share those changes with others.\nThese git configured set of files are called repositories or repos and are organised in a structured way.\nA rather large caveat is that:\n\nit is very much not advised to store data in these projects on git\nwhen working in groups, it is best to store data elsewhere and have scripts that interact with your local copy of the data\n\nIn my work, i use git to store text based code as a backup in case i make breaking changes to my analytical workflow that result in different results / different subsets of data etc.\nabcdefg",
51-
"crumbs": [
52-
"Basics",
53-
"Git Basics"
54-
]
55-
},
56-
{
57-
"objectID": "content/basicr.html",
58-
"href": "content/basicr.html",
59-
"title": "Base R",
60-
"section": "",
61-
"text": "this is your introduction to base R"
62-
},
63-
{
64-
"objectID": "content/basicr.html#introduction",
65-
"href": "content/basicr.html#introduction",
66-
"title": "Base R",
67-
"section": "",
68-
"text": "this is your introduction to base R"
69-
},
70-
{
71-
"objectID": "content/basicr.html#base-r",
72-
"href": "content/basicr.html#base-r",
73-
"title": "Base R",
74-
"section": "Base R",
75-
"text": "Base R"
76-
},
77-
{
78-
"objectID": "content/basicr.html#before-r-there-was",
79-
"href": "content/basicr.html#before-r-there-was",
80-
"title": "Base R",
81-
"section": "Before R there was?",
82-
"text": "Before R there was?"
89+
"text": "library(pacman)\np_load(here,\n tidyverse,\n magrittr,\n nomisr)\n\ntblCoD &lt;- nomisr::nomis_get_data(id = \"NM_161_1\",\n date = 2013:2021,\n geography = 2092957703,\n sex = 1:2,\n age = 1:20,\n measure = 1,\n measures = 20100,\n cause_of_death = c(0,9))\n\ntblCoD &lt;- tblCoD |&gt; \n dplyr::mutate(CoD = ifelse(CAUSE_OF_DEATH==9, \"CVD\", \"All\")) |&gt; \n dplyr::select(Year = DATE,\n Sex = GENDER_NAME,\n AgeCat = AGE_NAME,\n AgeC = AGE_CODE,\n N = OBS_VALUE,\n CoD) |&gt; \n tidyr::pivot_wider(values_from = N,\n names_from = CoD) |&gt; \n dplyr::mutate(pCVD = CVD / All,\n AgeLo = c(0,1,1:18*5)[AgeC],\n AgeHi = c(1,1:18*5,999)[AgeC])\n\ntblCoD &lt;- tblCoD |&gt; \n mutate(AgeCat = factor(AgeCat |&gt; \n stringr::str_remove_all(\"Aged \") |&gt; \n stringr::str_replace_all(\" to \", \"-\"),\n levels = c(\"under 1\", \"1-4\", paste0(1:17*5, \"-\", 1:17*5+4), \"90 and over\"),\n labels = c(\"&lt;1\", \"1-4\", paste0(1:17*5, \"-\", 1:17*5+4), \"90+\")))\n\ndevtools::source_gist(\"https://gist.github.com/gbrlrgrs/fec0190eb7b5884ca713c61651476b00\")\n\nℹ Sourcing gist \"fec0190eb7b5884ca713c61651476b00\"\nℹ SHA-1 hash of file is \"96040db56263e1143fbc6ebf63038a8e2511f4f3\"\n\nts = 20\nlw = 0.5\nfnSetGGPlotThemeGR(lw = lw, ts = ts)\n\ntblCoD |&gt; \n ggplot2::ggplot(ggplot2::aes(x=Year, y=pCVD, Group=AgeCat)) +\n ggplot2::geom_line(ggplot2::aes(colour=AgeCat)) +\n ggplot2::geom_text(data = tblCoD |&gt; dplyr::group_by(Sex, AgeCat) |&gt; dplyr::slice_tail(n=1),\n aes(x=Year+0.1, label = AgeCat), hjust=0, size = ts/.pt) +\n ggplot2::facet_grid(cols = ggplot2::vars(Sex)) +\n viridis::scale_colour_viridis(discrete = T, name = \"Age group\") +\n scale_y_continuous(limits = c(0, 0.35),\n breaks = 0:10/10,\n minor_breaks = 0:100/100,\n expand = c(0, 0),\n name = \"Proportion of deaths due to CVD\") +\n scale_x_continuous(limits = c(2013,2022),\n breaks = trunc(2014:2022/2)*2,\n minor_breaks = 2010:2025,\n expand = expansion(add = c(0.5, 1.5)),\n name = \"Year\") +\n theme(legend.position = \"none\",\n plot.margin = margin(1,1,1,1, \"cm\"))\n\n\n\n\n\n\n\n# fnSaveGG(strName = \"CVD_deaths\", cmW = 33.867, cmH = 19.05, typ = \"svg\")"
8390
}
8491
]

index.qmd

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
---
2-
title: "rforhta"
2+
title: "R for Health Technology Assesment"
33
---
44

55
This is a Quarto website.
66

7+
Quarto allows us to display code and its output
8+
79
To learn more about Quarto websites visit
810
<https://quarto.org/docs/websites>.
911

1012
```{r}
1113
1 + 1
1214
```
1315

14-
some changes
16+
17+
which wont tell automatically install the package if it is not installed for us.
18+
```{r echo=FALSE}
19+
library(ggplot2)
20+
library(palmerpenguins)
21+
```
22+
23+
An example is how to plot some data, fitted with a linear model and coloured by group
24+
```{r}
25+
ggplot(
26+
data = penguins,
27+
mapping = aes(x = flipper_length_mm, y = body_mass_g)
28+
) +
29+
geom_point(mapping = aes(color = species)) +
30+
geom_smooth(method = "lm")
31+
```

0 commit comments

Comments
 (0)