-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
* offstats template update * text changes * accredited stats * typo * corrections * management info template * minor text correction * offdev template * corrections and typos --------- Co-authored-by: Alan Yeung <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: phstemplates | ||
Title: PHS R Templates | ||
Version: 1.1.1 | ||
Version: 1.2.0 | ||
Authors@R: c( | ||
person("Public Health Scotland", , , "[email protected]", role = "cph"), | ||
person("Alan", "Yeung", , "[email protected]", role = c("aut", "cre"), | ||
|
@@ -34,4 +34,4 @@ Suggests: | |
tidyr | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 7.2.3 | ||
RoxygenNote: 7.3.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
--- | ||
output: | ||
phstemplates::phs_report_docx: | ||
reference_docx: "phs-natstats-report.docx" | ||
reference_docx: "phs-accstats-report.docx" | ||
fig_caption: no | ||
cover_page: "phs-natstats-cover.docx" | ||
cover_page: "phs-accstats-cover.docx" | ||
cover_title: "My Title" | ||
cover_subtitle: "My Subtitle" | ||
cover_date: "DD MM YYYY" | ||
|
@@ -14,7 +14,6 @@ output: | |
knitr::opts_chunk$set(echo = FALSE, dpi = 300) | ||
library(ggplot2) | ||
library(scales) | ||
library(captioner) | ||
library(flextable) | ||
library(officer) | ||
library(magrittr) | ||
|
@@ -35,6 +34,23 @@ table_data <- data.frame( | |
) | ||
``` | ||
|
||
```{r table-data2, include = FALSE} | ||
table_data2 <- data.frame( | ||
stringsAsFactors = FALSE, | ||
Table.Head = c( | ||
"Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.", | ||
Check warning on line 41 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
Check warning on line 41 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
|
||
"Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis", | ||
Check warning on line 42 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
Check warning on line 42 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
|
||
"Table Body" | ||
), | ||
Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.", | ||
Check warning on line 45 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
|
||
"1. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)", | ||
Check warning on line 46 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
|
||
"2. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)"), | ||
Check warning on line 47 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
|
||
Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.", | ||
Check warning on line 48 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
|
||
" • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2", | ||
Check warning on line 49 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
|
||
" • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2") | ||
Check warning on line 50 in inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd GitHub Actions / lint
|
||
) | ||
``` | ||
|
||
```{r figure, include = FALSE} | ||
# Create a pseudo chart | ||
yr <- c(rep("2014-15", times = 8), rep("2015-16", times = 8)) | ||
|
@@ -85,11 +101,6 @@ chart <- ggplot(data = chart_data, | |
axis.line = element_line(colour = "grey"), | ||
axis.ticks = element_line(colour = "grey") | ||
) | ||
# Figure numbering using the captioner package | ||
fig_nums <- captioner(prefix = "Figure", infix = ":") | ||
fig_nums(name = "chart", | ||
caption = "title ^1,2,\\*,\\ \\*\\*\\ +\\ footnote\\ reference^") | ||
``` | ||
|
||
# Introduction | ||
|
@@ -103,8 +114,8 @@ Praesent congue molestie nisi, ut congue dui mattis in. Vivamus vel urna risus. | |
|
||
# Main Points | ||
<Div custom-style = "Bullet 1">In tristique lobortis sagittis. Phasellus mollis mattis iaculis. Vivamus nunc justo, finibus nec maximus vel, ultricies vel urna. Ut ac mi sit amet augue fringilla egestas et ut mauris. Morbi volutpat, felis vel egestas scelerisque, nunc purus auctor ligula, non lobortis nulla felis in tortor. In nec commodo sem.</Div> | ||
<Div custom-style = "Bullet 1">Proin vitae vehicula purus. Cras consequat iaculis venenatis. Morbi vel risus vestibulum, aliquet mi in, volutpat massa. Sed urna sem, posuere eu semper vitae, ullamcorper quis leo. Mauris nisi metus, scelerisque sed urna eu, maximus porttitor ante. Sed scelerisque accumsan commodo. Sed interdum justo volutpat, sodales nisi sed, consectetur arcu. Interdum et malesuada fames ac ante ipsum primis in faucibus.</Div> | ||
<Div custom-style = "Bullet 1">Praesent congue molestie nisi, ut congue dui mattis in. Vivamus vel urna risus. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus.</Div> | ||
<Div custom-style = "Bullet 2">Proin vitae vehicula purus. Cras consequat iaculis venenatis. Morbi vel risus vestibulum, aliquet mi in, volutpat massa. Sed urna sem, posuere eu semper vitae, ullamcorper quis leo. Mauris nisi metus, scelerisque sed urna eu, maximus porttitor ante. Sed scelerisque accumsan commodo. Sed interdum justo volutpat, sodales nisi sed, consectetur arcu. Interdum et malesuada fames ac ante ipsum primis in faucibus.</Div> | ||
<Div custom-style = "Bullet 1">Praesent congue molestie nisi, ut congue dui mattis in. **Vivamus vel urna risus**. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus.</Div> | ||
|
||
\newpage | ||
|
||
|
@@ -133,8 +144,8 @@ my_ft_format <- function(ft) { | |
part = "all") | ||
} | ||
headings <- list("Table Head", "Table Head", "Table Head", "Table Head", | ||
"Table Head") | ||
headings <- list("Table head", "Table head", "Table head", "Table head", | ||
"Table head") | ||
names(headings) <- names(table_data) | ||
flextable(table_data, theme_fun = NULL) %>% | ||
|
@@ -149,26 +160,46 @@ flextable(table_data, theme_fun = NULL) %>% | |
|
||
<br> | ||
|
||
<Div custom-style = "Table or chart caption">`r fig_nums("chart")`</Div> | ||
<Div custom-style = "Table or chart caption">Table or chart caption</Div> | ||
```{r flextable-table-data2, ft.align = "left"} | ||
headings2 <- list("Table Head", "Table Head", "Table Head") | ||
names(headings2) <- names(table_data2) | ||
flextable(table_data2, theme_fun = NULL) %>% | ||
my_ft_format() %>% | ||
set_header_labels(values = headings2) %>% | ||
height(height = 0.236, part = "body") %>% | ||
hrule(rule = "atleast", part = "body") %>% | ||
width(width = 2.1) %>% | ||
append_chunks( | ||
part = "body", i = 3, j = 1, | ||
as_chunk(" text + hyperlink", | ||
props = fp_text(color = "#005c99", bold = TRUE, font.size = 12)) | ||
) | ||
``` | ||
|
||
\newpage | ||
|
||
<Div custom-style = "Table or chart caption">Figure 1: title ^1,2,\*,\ \*\*\ +\ footnote\ reference^</Div> | ||
```{r chart, fig.width=7.18, fig.height=3.31, fig.cap="Appropriate ALT Text to be added."} | ||
chart | ||
``` | ||
<Div custom-style = "Footnote Text"> | ||
1 Footnote text one. | ||
|
||
2 Footnote text two. | ||
<Div custom-style = "Table or chart note"> | ||
1. \ \ \ Vivamus molestie massa in quam porttitor viverra. Nulla facilisi. Suspendisse fermentum metus justo, vel elementum ante rutrum eget. | ||
|
||
\* Footnote text three. | ||
2. \ \ \ Vivamus molestie massa in quam porttitor viverra. Nulla facilisi. Suspendisse fermentum metus justo, vel Vivamus molestie massa in quam porttitor viverra. Nulla facilisi. Suspendisse fermentum metus justo. | ||
|
||
\*\* Footnote text four. | ||
3. \ \ \ Vivamus molestie massa in quam porttitor viverra. Nulla facilisi. Suspendisse fermentum metus justo, vel elementum ante rutrum eget. | ||
</Div> | ||
|
||
<br> | ||
|
||
### Heading 3 | ||
Fusce hendrerit nibh sit amet tellus tincidunt vehicula. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam non libero eu orci viverra rhoncus eu sed massa. | ||
|
||
Mauris ac neque vel erat varius cursus. Praesent at molestie felis. Nunc eget ipsum non lectus facilisis dictum quis viverra magna. Pellentesque elementum condimentum accumsan. Nunc vel pharetra augue. Pellentesque vitae lectus cursus magna blandit aliquet. In aliquet sapien sit amet viverra aliquam. | ||
|
||
Pellentesque aliquam imperdiet neque et interdum. Nulla sodales tellus magna, id venenatis justo pulvinar ut. Etiam luctus facilisis auctor. Curabitur interdum feugiat convallis. Nullam mi libero, hendrerit vitae condimentum in, iaculis porta purus. Suspendisse potenti. Donec sed molestie nisi, ut blandit ex. Proin tempor, mauris sit amet consectetur placerat, elit lorem placerat dui, sed placerat mi ante a purus. | ||
Pellentesque aliquam imperdiet neque et interdum. Nulla sodales tellus magna, id venenatis justo pulvinar ut. Etiam luctus facilisis auctor. Curabitur interdum feugiat convallis. Nullam mi libero, hendrerit vitae condimentum in, iaculis porta purus. | ||
|
||
Suspendisse potenti. Donec sed molestie nisi, ut blandit ex. Proin tempor, mauris sit amet consectetur placerat, elit lorem placerat dui, sed placerat mi ante a purus. | ||
|
||
|
@@ -188,12 +219,12 @@ Glossary item description | |
\newpage | ||
|
||
# Contact | ||
**Name, Job Title** | ||
**Name, Job title** | ||
Service | ||
Phone number | ||
[[email protected]](mailto:[email protected]) | ||
|
||
**Name, Job Title** | ||
**Name, Job title** | ||
Service | ||
Phone number | ||
[[email protected]](mailto:[email protected]) | ||
|
@@ -280,7 +311,7 @@ DD Month YYYY | |
[Insert details about how these statistics can be compared] | ||
|
||
**Accessibility** | ||
It is the policy of Public Health Scotland to make its web sites and products accessible according to published guidelines. More information on accessibility can be found on the [PHS website](https://beta.isdscotland.org/front-matter/accessibility-statement/). | ||
It is the policy of Public Health Scotland to make its web sites and products accessible according to published guidelines. More information on accessibility can be found on the [PHS website](https://publichealthscotland.scot/accessibility/). | ||
|
||
**Coherence and clarity** | ||
[Insert details about how the coherence and clarity of this publication] | ||
|
@@ -291,10 +322,10 @@ It is the policy of Public Health Scotland to make its web sites and products ac | |
**Disclosure** | ||
[Insert details about disclosure levels of risk in relation to this publication] | ||
|
||
**Official Statistics designation** | ||
Experimental Statistics | ||
**Official Statistics accreditation** | ||
Accredited official statistics | ||
|
||
**UK Statistics Authority Assessment** | ||
**UK Statistics Authority assessment** | ||
[Insert details about the UK Stats Authority assessment of this publication] | ||
|
||
**Last published** | ||
|
@@ -317,30 +348,53 @@ DD Month YYYY | |
|
||
## Appendix 3 - Early access details | ||
|
||
### Pre-Release Access | ||
### Pre-release access | ||
|
||
Under terms of the "Pre-Release Access to Official Statistics (Scotland) Order 2008", PHS is obliged to publish information on those receiving Pre-Release Access ("Pre-Release Access" refers to statistics in their final form prior to publication). The standard maximum Pre-Release Access is five working days. Shown below are details of those receiving standard Pre-Release Access. | ||
Under terms of the 'Pre-release Access to Official Statistics (Scotland) Order 2008', PHS is obliged to publish information on those receiving pre-release access ('pre-release access' refers to statistics in their final form prior to publication). The standard maximum pre-release access is five working days. Shown below are details of those receiving standard pre-release access. | ||
|
||
### Standard Pre-Release Access | ||
### Standard pre-release access: | ||
|
||
Scottish Government Health Department | ||
Scottish Government Department of Health and Social Care (DHSC) | ||
|
||
NHS Board Chief Executives | ||
NHS board chief executives | ||
|
||
NHS Board Communication leads | ||
NHS board communication leads | ||
|
||
### Early Access for Management Information | ||
### Early access for management information | ||
|
||
These statistics will also have been made available to those who needed access to 'management information', ie as part of the delivery of health and care: | ||
These statistics will also have been made available to those who needed access to 'management information', i.e. as part of the delivery of health and care: | ||
|
||
### Early Access for Quality Assurance | ||
### Early access for quality assurance | ||
|
||
These statistics will also have been made available to those who needed access to help quality assure the publication: | ||
|
||
\newpage | ||
|
||
## Appendix 4 – PHS and Official Statistics | ||
## Appendix 4 – PHS and official statistics | ||
|
||
### About Public Health Scotland (PHS) | ||
|
||
PHS is a knowledge-based and intelligence driven organisation with a critical reliance on data and information to enable it to be an independent voice for the public's health, leading collaboratively and effectively across the Scottish public health system, accountable at local and national levels, and providing leadership and focus for achieving better health and wellbeing outcomes for the population. Our statistics comply with the [Code of Practice for Statistics](https://www.statisticsauthority.gov.uk/code-of-practice/the-code/) in terms of trustworthiness, high quality and public value. This also means that we keep data secure at all stages, through collection, processing, analysis and output production, and adhere to the '[five safes](https://blog.ons.gov.uk/2017/01/27/the-five-safes-data-privacy-at-ons/)'. | ||
PHS is a knowledge-based and intelligence driven organisation with a critical reliance on data and information to enable it to be an independent voice for the public's health, leading collaboratively and effectively across the Scottish public health system, accountable at local and national levels, and providing leadership and focus for achieving better health and wellbeing outcomes for the population. Our statistics comply with the [Code of Practice for Statistics](https://www.statisticsauthority.gov.uk/code-of-practice/the-code/) in terms of trustworthiness, high quality and public value. This also means that we keep data secure at all stages, through collection, processing, analysis and output production, and adhere to the Office for National Statistics '[Five Safes](https://blog.ons.gov.uk/2017/01/27/the-five-safes-data-privacy-at-ons/)' of data privacy. | ||
|
||
<br> | ||
|
||
<br> | ||
|
||
<br> | ||
|
||
<br> | ||
|
||
<br> | ||
|
||
<br> | ||
|
||
<br> | ||
|
||
<br> | ||
|
||
<Div custom-style = "*Other formats textbox (only for RMarkdown use)"> | ||
Translations and other formats are available on request at: | ||
[email protected] or 0131 314 5300. | ||
|
||
This publication is licensed for re-use under the [Open Government Licence v3.0](http://www.nationalarchives.gov.uk/doc/open-government-licence/). For more information, visit [www.publichealthscotland.scot/ogl](http://www.publichealthscotland.scot/ogl) | ||
</Div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: PHS Accredited Official Stats Report | ||
description: Template to produce a PHS accredited official stats report document | ||
create_dir: FALSE |