diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml
index b70839b..58754e3 100644
--- a/.github/workflows/R-CMD-check.yaml
+++ b/.github/workflows/R-CMD-check.yaml
@@ -24,14 +24,11 @@ jobs:
config:
# Windows
- {os: windows-latest, r: 'release', allow_fail: false}
- # Use 3.6 to trigger usage of RTools35
- - {os: windows-latest, r: '3.6', allow_fail: true}
# Linux
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release', allow_fail: true}
- {os: ubuntu-latest, r: 'release', allow_fail: false}
- {os: ubuntu-latest, r: '4.1.2', allow_fail: false}
- {os: ubuntu-latest, r: '4.0.2', allow_fail: false}
- - {os: ubuntu-latest, r: '3.6.1', allow_fail: true}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
diff --git a/DESCRIPTION b/DESCRIPTION
index 3154cb8..1fcd88d 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -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", , , "phs.datascience@phs.scot", role = "cph"),
person("Alan", "Yeung", , "alan.yeung@phs.scot", role = c("aut", "cre"),
@@ -34,4 +34,4 @@ Suggests:
tidyr
Encoding: UTF-8
LazyData: true
-RoxygenNote: 7.2.3
+RoxygenNote: 7.3.1
diff --git a/NEWS.md b/NEWS.md
index 568092d..d47aa66 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,8 @@
+# phstemplates 1.2.0
+
+* Updated official statistics, accredited official statistics (formerly national statistics), official statistics in development and management information templates to 2024 versions.
+* Removed the use of the captioner package in report templates as it is no longer on CRAN.
+
# phstemplates 1.1.1
* Added three Management information templates for Word documents, accessible through RStudio menu: a Management Info Report, A Management Info Summary, and, a Management Info One Page template.
diff --git a/R/phs_report_docx.R b/R/phs_report_docx.R
index dfad4cb..3ab1350 100644
--- a/R/phs_report_docx.R
+++ b/R/phs_report_docx.R
@@ -115,7 +115,7 @@ phs_report_docx <- function(toc = FALSE,
# Cover Page
cover_page <- officer::read_docx(cover) %>%
- officer::body_replace_all_text("Title", title) %>%
+ officer::body_replace_all_text("Publication title", title) %>%
officer::body_replace_all_text("Subtitle", stitle) %>%
officer::body_replace_all_text("DD Month YYYY", dt)
@@ -132,7 +132,6 @@ phs_report_docx <- function(toc = FALSE,
# Combine Cover and Report
cover_page %>%
officer::cursor_end() %>%
- officer::body_remove() %>%
officer::body_add_break() %>%
officer::body_add_xml(str = xml_elt) %>%
officer::set_doc_properties(title = title) %>%
diff --git a/R/phstemplates.R b/R/phstemplates.R
index 9d92e7f..4128b91 100644
--- a/R/phstemplates.R
+++ b/R/phstemplates.R
@@ -5,6 +5,5 @@
#' See the README on
#' \href{https://github.com/Public-Health-Scotland/phstemplates#readme}{GitHub}.
#'
-#' @docType package
#' @name phstemplates
-NULL
+"_PACKAGE"
diff --git a/inst/rmarkdown/templates/phs-natstats-report/skeleton/phs-natstats-cover.docx b/inst/rmarkdown/templates/phs-accstats-report/skeleton/phs-accstats-cover.docx
similarity index 78%
rename from inst/rmarkdown/templates/phs-natstats-report/skeleton/phs-natstats-cover.docx
rename to inst/rmarkdown/templates/phs-accstats-report/skeleton/phs-accstats-cover.docx
index 4ebb89c..b6a7992 100644
Binary files a/inst/rmarkdown/templates/phs-natstats-report/skeleton/phs-natstats-cover.docx and b/inst/rmarkdown/templates/phs-accstats-report/skeleton/phs-accstats-cover.docx differ
diff --git a/inst/rmarkdown/templates/phs-accstats-report/skeleton/phs-accstats-report.docx b/inst/rmarkdown/templates/phs-accstats-report/skeleton/phs-accstats-report.docx
new file mode 100644
index 0000000..25307a2
Binary files /dev/null and b/inst/rmarkdown/templates/phs-accstats-report/skeleton/phs-accstats-report.docx differ
diff --git a/inst/rmarkdown/templates/phs-natstats-report/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd
similarity index 76%
rename from inst/rmarkdown/templates/phs-natstats-report/skeleton/skeleton.Rmd
rename to inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd
index 56495eb..a81fb5a 100644
--- a/inst/rmarkdown/templates/phs-natstats-report/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/phs-accstats-report/skeleton/skeleton.Rmd
@@ -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.",
+ "Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis",
+ "Table Body"
+ ),
+ Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.",
+ "1. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)",
+ "2. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)"),
+ Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.",
+ " • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2",
+ " • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2")
+)
+```
+
```{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
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.
-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.
-Praesent congue molestie nisi, ut congue dui mattis in. Vivamus vel urna risus. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus.
+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.
+Praesent congue molestie nisi, ut congue dui mattis in. **Vivamus vel urna risus**. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus.
\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) %>%
-1 Footnote text one.
-
-2 Footnote text two.
+
+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.
+
+
### 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
[phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
-**Name, Job Title**
+**Name, Job title**
Service
Phone number
[phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
@@ -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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Translations and other formats are available on request at:
+phs.otherformats@phs.scot 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)
+
diff --git a/inst/rmarkdown/templates/phs-accstats-report/template.yaml b/inst/rmarkdown/templates/phs-accstats-report/template.yaml
new file mode 100644
index 0000000..ac058e8
--- /dev/null
+++ b/inst/rmarkdown/templates/phs-accstats-report/template.yaml
@@ -0,0 +1,3 @@
+name: PHS Accredited Official Stats Report
+description: Template to produce a PHS accredited official stats report document
+create_dir: FALSE
diff --git a/inst/rmarkdown/templates/phs-accstats-summary/skeleton/phs-accstats-summary.docx b/inst/rmarkdown/templates/phs-accstats-summary/skeleton/phs-accstats-summary.docx
new file mode 100644
index 0000000..70105df
Binary files /dev/null and b/inst/rmarkdown/templates/phs-accstats-summary/skeleton/phs-accstats-summary.docx differ
diff --git a/inst/rmarkdown/templates/phs-accstats-summary/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/phs-accstats-summary/skeleton/skeleton.Rmd
new file mode 100644
index 0000000..10b09f6
--- /dev/null
+++ b/inst/rmarkdown/templates/phs-accstats-summary/skeleton/skeleton.Rmd
@@ -0,0 +1,121 @@
+---
+output:
+ word_document:
+ reference_docx: "phs-accstats-summary.docx"
+ fig_caption: no
+---
+
+
+```{r setup, include = FALSE}
+knitr::opts_chunk$set(echo = FALSE, dpi = 300)
+library(ggplot2)
+
+# Create a pseudo chart
+yr <- c(rep("2014-15", times = 8), rep("2015-16", times = 8))
+mth <- rep(c("Apr", "May", "Jun", "July", "Aug", "Sep", "Oct", "Nov"),
+ times = 2)
+counts <- c(1100, 1220, 1240, 1250, 1290, 1300, 1380, 1350,
+ 1100, 1140, 1150, 1150, 1190, 1260, 1270, 1280)
+
+chart_data <- data.frame(yr, mth, counts)
+
+chart <- ggplot(data = chart_data,
+ aes(x = mth, y = counts, group = yr, color = yr,
+ shape = yr)) +
+ geom_line(size = 0.75) +
+ geom_point(size = c(rep(3, 8), rep(2.5, 8))) +
+ xlab("Month") +
+ scale_x_discrete(limits = c("Apr", "May", "Jun", "July", "Aug", "Sep",
+ "Oct", "Nov"),
+ labels = c("Apr", "May", "Jun", "July", "Aug", "Sep",
+ "Oct", "Nov")) +
+ scale_y_continuous(breaks = c(200, 400, 600, 800, 1000, 1200, 1400, 1600),
+ labels = c("200", "400", "600", "800", "1,000", "1,200",
+ "1,400", "1,600"),
+ limits = c(0, 1600), expand = expansion(mult = 0)) +
+ scale_color_manual(values = c("#9B4393", "#0078D4")) +
+ scale_shape_manual(values = c("diamond", "square")) +
+ theme(
+ plot.title = element_text(hjust = 0.5, face = "bold", size = 12,
+ colour = "#6C2383"),
+ plot.margin = margin(l = 30, b = 10),
+ panel.background = element_blank(),
+ panel.grid.major = element_blank(),
+ panel.grid.minor = element_blank(),
+ panel.grid.major.y = element_line(size = 0.4, color = "#969696"),
+ panel.border = element_rect(colour = "#969696", fill = NA, size = 0.75),
+ legend.position = "top",
+ legend.title = element_blank(),
+ legend.box.spacing = unit(0, "cm"),
+ legend.box.margin = margin(b = 0),
+ legend.key.height = unit(10, "pt"),
+ legend.key.width = unit(30, "pt"),
+ legend.text = element_text(size = 8),
+ axis.title.x = element_text(size = 8, face = "bold",
+ margin = margin(t = 10)),
+ axis.title.y = element_blank(),
+ axis.text.x = element_text(size = 7.5, color = "black"),
+ axis.text.y = element_text(size = 7, color = "black"),
+ axis.line = element_line(colour = "grey"),
+ axis.ticks = element_line(colour = "grey")
+ )
+```
+
+
Publication title
+
Subtitle
+
An Accredited official statistics release for Scotland
+
Publication date: DD Month YYYY
+
RESTRICTED STATISTICS: embargoed to 09:30 dd/mm/yyyy
+
+# About this release
+Vestibulum lacinia, turpis eu sagittis lacinia, justo orci blandit orci, ut suscipit tortor turpis et metus. Pellentesque sollicitudin nisl et porttitor laoreet. Nunc id purus pretium, suscipit justo vitae, pretium dui. Quisque congue ex dignissim tellus pulvinar, a interdum libero fermentum.
+
+# Main Points
+Proin nec ultricies dolor. Maecenas pulvinar, enim et imperdiet cursus, mi
+
+
Maecenas ut sagittis mi. Vestibulum faucibus ligula sit amet facilisis pulvinar. Morbi mollis odio id est consequat, a convallis quam finibus. Morbi id congue turpis, sit amet ultrices tortor. Phasellus vel nisi.
+
Quisque iaculis congue aliquet. Aenean in dictum nisl. Etiam quis ullamcorper ex. Aenean mollis ante eget.
+
+
`Chart title`
+```{r chart, fig.width=7.18, fig.height=3.31, fig.cap="Appropriate ALT Text to be added."}
+chart
+```
+
+Maecenas bibendum consequat vehicula. Fusce id viverra lorem, et
+
+
Curabitur luctus luctus lorem, at commodo mauris rutrum quis. Mauris aliquet turpis vel magna bibendum hendrerit. Nulla finibus porta sapien ut pretium. Aliquam elementum mauris.
+
Vivamus bibendum ut tellus rhoncus porttitor. Nam id nibh et.
+
Ut in dapibus massa, ut gravida ligula. Vestibulum ut consectetur:
+
Vivamus luctus varius nibh, a scelerisque ex tincidunt non. Etiam dignissim.
+
Curabitur laoreet viverra magna eget dapibus. Maecenas scelerisque euismod mattis. Sed cursus.
+
Sed in iaculis lectus, sed fermentum urna. Donec efficitur diam eu ipsum viverra, eu ornare justo mollis. Phasellus in dictum tellus.
+
+# Background
+Aliquam sed maximus ante, a imperdiet est. Vivamus vel diam facilisis, pulvinar erat consequat, consequat nulla. Praesent lorem dolor, luctus ut libero vitae, venenatis congue tortor.
+
+Nunc at mauris euismod, mattis tellus sed, vehicula dolor. Duis quis auctor elit. Fusce eu dui eu magna convallis porttitor in ac purus. Proin sed tellus massa. In pulvinar augue sit amet faucibus maximus. Aenean porttitor arcu vitae lacus fringilla condimentum. Praesent laoreet, felis non dignissim viverra, libero nunc eleifend sapien, sed dignissim felis risus et tellus.
+
+# Contact
+Name | Role | Number | [phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
+
+Name | Role | Number | [phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
+
+For all media enquiries please email [phs.comms@phs.scot](mailto:phs.comms@phs.scot) or call 0131 275 6105.
+
+# Further information
+Our statistical practice is regulated by the Office for Statistics Regulation (OSR). These accredited official statistics were independently reviewed by the Office for Statistics Regulation in [month/year]. They comply with the standards of trustworthiness, quality and value in the Code of Practice for Statistics and should be labelled 'accredited official statistics'.
+
+Accredited official statistics are called National Statistics in the Statistics and Registration Service Act 2007. Visit the UK Statistics Authority website for more information about the [Code of Practice](https://code.statisticsauthority.gov.uk/) and [Accredited official statistics](https://code.statisticsauthority.gov.uk/glossary/#pid-accredited-official-statistics).
+
+Visit our website for [further information about our statistics and PHS as an Official Statistics producer.](https://publichealthscotland.scot/our-organisation/about-our-statistics/official-statistics/)
+
+Data from this publication are available from the [publication page](https://publichealthscotland.scot/publications/YOUR-PUBLICATION-URL) on our website.
+
+Open data from this publication is available from the [Scottish Health and Social Care Open Data platform](https://www.opendata.nhs.scot/).
+
+The next release of this publication will be DD Month YYYY.
+
+Other formats of this publication are available on request by calling 0131 314 5300 or emailing [phs.otherformats@phs.scot](mailto:phs.otherformats@phs.scot).
+
+# NHS Performs
+A selection of information from this publication is included in [NHS Performs](http://www.nhsperforms.scot). NHS Performs is a website that brings together a range of information on how hospitals and NHS Boards within NHSScotland are performing.
diff --git a/inst/rmarkdown/templates/phs-accstats-summary/template.yaml b/inst/rmarkdown/templates/phs-accstats-summary/template.yaml
new file mode 100644
index 0000000..ac54329
--- /dev/null
+++ b/inst/rmarkdown/templates/phs-accstats-summary/template.yaml
@@ -0,0 +1,3 @@
+name: PHS Accredited Official Stats Summary
+description: Template to produce a PHS accredited official stats summary document
+create_dir: FALSE
diff --git a/inst/rmarkdown/templates/phs-mnginfo-onepage/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/phs-mnginfo-onepage/skeleton/skeleton.Rmd
index d19779f..a32a634 100755
--- a/inst/rmarkdown/templates/phs-mnginfo-onepage/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/phs-mnginfo-onepage/skeleton/skeleton.Rmd
@@ -5,9 +5,9 @@ output:
fig_caption: no
---
-
Publication Title
+
Publication title
Subtitle
-
A Management Information release for Scotland
+
A Management information release for Scotland
Publication date: DD Month YYYY
RESTRICTED STATISTICS: embargoed to 09:30 dd/mm/yyyy
diff --git a/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/phs-mngtinfo-cover.docx b/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/phs-mngtinfo-cover.docx
index 8468453..4553bb9 100755
Binary files a/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/phs-mngtinfo-cover.docx and b/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/phs-mngtinfo-cover.docx differ
diff --git a/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/phs-mngtinfo-report.docx b/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/phs-mngtinfo-report.docx
index 2fa2043..5f9505a 100755
Binary files a/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/phs-mngtinfo-report.docx and b/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/phs-mngtinfo-report.docx differ
diff --git a/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/skeleton.Rmd
index 8f4e845..22f9f0c 100755
--- a/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/phs-mnginfo-report/skeleton/skeleton.Rmd
@@ -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.",
+ "Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis",
+ "Table Body"
+ ),
+ Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.",
+ "1. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)",
+ "2. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)"),
+ Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.",
+ " • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2",
+ " • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2")
+)
+```
+
```{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
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.
-
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.
-
Praesent congue molestie nisi, ut congue dui mattis in. Vivamus vel urna risus. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus.
+
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.
+
Praesent congue molestie nisi, ut congue dui mattis in. **Vivamus vel urna risus**. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus.
\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) %>%
-
`r fig_nums("chart")`
+
Table or chart caption
+```{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
+
+
Figure 1: title ^1,2,\*,\ \*\*\ +\ footnote\ reference^
```{r chart, fig.width=7.18, fig.height=3.31, fig.cap="Appropriate ALT Text to be added."}
chart
```
-
-1 Footnote text one.
-
-2 Footnote text two.
+
+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.
+
+
### 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
[phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
-**Name, Job Title**
+**Name, Job title**
Service
Phone number
[phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
@@ -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**
+Management information
-**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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Translations and other formats are available on request at:
+phs.otherformats@phs.scot 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)
+
diff --git a/inst/rmarkdown/templates/phs-mnginfo-summary/skeleton/phs-mngtinfo-summary.docx b/inst/rmarkdown/templates/phs-mnginfo-summary/skeleton/phs-mngtinfo-summary.docx
index 4847ad8..4574665 100755
Binary files a/inst/rmarkdown/templates/phs-mnginfo-summary/skeleton/phs-mngtinfo-summary.docx and b/inst/rmarkdown/templates/phs-mnginfo-summary/skeleton/phs-mngtinfo-summary.docx differ
diff --git a/inst/rmarkdown/templates/phs-mnginfo-summary/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/phs-mnginfo-summary/skeleton/skeleton.Rmd
index f61eb13..e57248b 100755
--- a/inst/rmarkdown/templates/phs-mnginfo-summary/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/phs-mnginfo-summary/skeleton/skeleton.Rmd
@@ -61,9 +61,9 @@ chart <- ggplot(data = chart_data,
)
```
-
Publication Title
+
Publication Title
Subtitle
-
A Management Information release for Scotland
+
A Management information release for Scotland
Publication date: DD Month YYYY
RESTRICTED STATISTICS: embargoed to 09:30 dd/mm/yyyy
@@ -103,10 +103,14 @@ Name | Role | Number | [phs.generic-team-email@phs.scot](mailto:phs.generic-team
For all media enquiries please email [phs.comms@phs.scot](mailto:phs.comms@phs.scot) or call 0131 275 6105.
# Further information
-Data from this publication are available from the [publication page](https://beta.isdscotland.org/find-publications-and-data/YOUR-PUBLICATION-URL) on our website.
+Data from this publication are available from the [publication page](https://publichealthscotland.scot/publications/YOUR-PUBLICATION-URL) on our website.
Open data from this publication is available from the [Scottish Health and Social Care Open Data platform](https://www.opendata.nhs.scot/).
+Our statistical practice is regulated by the Office for Statistics Regulation (OSR).
+
+Visit our website for [further information about our statistics and PHS as an Official Statistics producer.](https://publichealthscotland.scot/our-organisation/about-our-statistics/official-statistics/)
+
The next release of this publication will be DD Month YYYY.
Other formats of this publication are available on request by calling 0131 314 5300 or emailing [phs.otherformats@phs.scot](mailto:phs.otherformats@phs.scot).
diff --git a/inst/rmarkdown/templates/phs-natstats-report/skeleton/phs-natstats-report.docx b/inst/rmarkdown/templates/phs-natstats-report/skeleton/phs-natstats-report.docx
deleted file mode 100644
index a080e64..0000000
Binary files a/inst/rmarkdown/templates/phs-natstats-report/skeleton/phs-natstats-report.docx and /dev/null differ
diff --git a/inst/rmarkdown/templates/phs-natstats-report/template.yaml b/inst/rmarkdown/templates/phs-natstats-report/template.yaml
deleted file mode 100644
index b055046..0000000
--- a/inst/rmarkdown/templates/phs-natstats-report/template.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: PHS National Stats Report
-description: Template to produce a PHS national stats report document
-create_dir: FALSE
diff --git a/inst/rmarkdown/templates/phs-natstats-summary/skeleton/phs-natstats-summary.docx b/inst/rmarkdown/templates/phs-natstats-summary/skeleton/phs-natstats-summary.docx
deleted file mode 100644
index a50c83c..0000000
Binary files a/inst/rmarkdown/templates/phs-natstats-summary/skeleton/phs-natstats-summary.docx and /dev/null differ
diff --git a/inst/rmarkdown/templates/phs-natstats-summary/template.yaml b/inst/rmarkdown/templates/phs-natstats-summary/template.yaml
deleted file mode 100644
index 1ab877f..0000000
--- a/inst/rmarkdown/templates/phs-natstats-summary/template.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: PHS National Stats Summary
-description: Template to produce a PHS national stats summary document
-create_dir: FALSE
diff --git a/inst/rmarkdown/templates/phs-offdev-report/skeleton/phs-offdev-cover.docx b/inst/rmarkdown/templates/phs-offdev-report/skeleton/phs-offdev-cover.docx
new file mode 100644
index 0000000..6b2ebdf
Binary files /dev/null and b/inst/rmarkdown/templates/phs-offdev-report/skeleton/phs-offdev-cover.docx differ
diff --git a/inst/rmarkdown/templates/phs-offdev-report/skeleton/phs-offdev-report.docx b/inst/rmarkdown/templates/phs-offdev-report/skeleton/phs-offdev-report.docx
new file mode 100644
index 0000000..3c8f95a
Binary files /dev/null and b/inst/rmarkdown/templates/phs-offdev-report/skeleton/phs-offdev-report.docx differ
diff --git a/inst/rmarkdown/templates/phs-offdev-report/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/phs-offdev-report/skeleton/skeleton.Rmd
new file mode 100644
index 0000000..6931f37
--- /dev/null
+++ b/inst/rmarkdown/templates/phs-offdev-report/skeleton/skeleton.Rmd
@@ -0,0 +1,400 @@
+---
+output:
+ phstemplates::phs_report_docx:
+ reference_docx: "phs-offdev-report.docx"
+ fig_caption: no
+ cover_page: "phs-offdev-cover.docx"
+ cover_title: "My Title"
+ cover_subtitle: "My Subtitle"
+ cover_date: "DD MM YYYY"
+ toc_depth: 3
+---
+
+```{r setup, include = FALSE}
+knitr::opts_chunk$set(echo = FALSE, dpi = 300)
+library(ggplot2)
+library(scales)
+library(flextable)
+library(officer)
+library(magrittr)
+```
+
+```{r table-data, include = FALSE}
+table_data <- data.frame(
+ stringsAsFactors = FALSE,
+ Table.Head = c(
+ "Table body", "Table body", "Table body",
+ "Table body (with Total Row option in Table Style options ticked)"
+ ),
+ Table.Head = c("Table body right aligned (for numbers) 22", "22", "22",
+ "221"),
+ Table.Head = c(72081L, 72081L, 72081L, 910937L),
+ Table.Head = c(30.5, 30.5, 30.5, 24.3),
+ Table.Head = c(19L, 19L, 19L, 257L)
+)
+```
+
+```{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.",
+ "Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis",
+ "Table Body"
+ ),
+ Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.",
+ "1. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)",
+ "2. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)"),
+ Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.",
+ " • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2",
+ " • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2")
+)
+```
+
+```{r figure, include = FALSE}
+# Create a pseudo chart
+yr <- c(rep("2014-15", times = 8), rep("2015-16", times = 8))
+mth <- rep(c("Apr", "May", "Jun", "July", "Aug", "Sep", "Oct", "Nov"),
+ times = 2)
+counts <- c(1100, 1220, 1240, 1250, 1290, 1300, 1380, 1350,
+ 1100, 1140, 1150, 1150, 1190, 1260, 1270, 1280)
+
+chart_data <- data.frame(yr, mth, counts)
+
+chart <- ggplot(data = chart_data,
+ aes(x = mth, y = counts, group = yr, color = yr,
+ shape = yr)) +
+ geom_line(size = 0.75) +
+ geom_point(size = c(rep(3, 8), rep(2.5, 8))) +
+ xlab("Month") +
+ scale_x_discrete(limits = c("Apr", "May", "Jun", "July", "Aug", "Sep",
+ "Oct", "Nov"),
+ labels = c("Apr", "May", "Jun", "July", "Aug", "Sep",
+ "Oct", "Nov")) +
+ scale_y_continuous(breaks = c(200, 400, 600, 800, 1000, 1200, 1400, 1600),
+ labels = c("200", "400", "600", "800", "1,000", "1,200",
+ "1,400", "1,600"),
+ limits = c(0, 1600), expand = expansion(mult = 0)) +
+ scale_color_manual(values = c("#9B4393", "#0078D4")) +
+ scale_shape_manual(values = c("diamond", "square")) +
+ theme(
+ plot.title = element_text(hjust = 0.5, face = "bold", size = 12,
+ colour = "#6C2383"),
+ plot.margin = margin(l = 30, b = 10),
+ panel.background = element_blank(),
+ panel.grid.major = element_blank(),
+ panel.grid.minor = element_blank(),
+ panel.grid.major.y = element_line(size = 0.4, color = "#969696"),
+ panel.border = element_rect(colour = "#969696", fill = NA, size = 0.75),
+ legend.position = "top",
+ legend.title = element_blank(),
+ legend.box.spacing = unit(0, "cm"),
+ legend.box.margin = margin(b = 0),
+ legend.key.height = unit(10, "pt"),
+ legend.key.width = unit(30, "pt"),
+ legend.text = element_text(size = 8),
+ axis.title.x = element_text(size = 8, face = "bold",
+ margin = margin(t = 10)),
+ axis.title.y = element_blank(),
+ axis.text.x = element_text(size = 7.5, color = "black"),
+ axis.text.y = element_text(size = 7, color = "black"),
+ axis.line = element_line(colour = "grey"),
+ axis.ticks = element_line(colour = "grey")
+ )
+```
+
+# Introduction
+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. Donec a dolor gravida, lobortis ligula vitae, pulvinar ante. Integer faucibus eros ut luctus tristique.
+
+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. [Donec sodales lacus in erat elementum viverra](https://publichealthscotland.scot/). Phasellus faucibus faucibus erat vitae pharetra. Mauris sed blandit dolor. Duis consequat fermentum diam quis elementum. Maecenas euismod non lorem sit amet ornare.
+
+Praesent congue molestie nisi, ut congue dui mattis in. Vivamus vel urna risus. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus. Vivamus molestie massa in quam porttitor viverra. Nulla facilisi. Suspendisse fermentum metus justo, vel elementum ante rutrum eget.
+
+\newpage
+
+# Main Points
+
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.
+
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.
+
Praesent congue molestie nisi, ut congue dui mattis in. **Vivamus vel urna risus**. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus.
+
+\newpage
+
+# Results and Commentary
+Suspendisse velit nisi, tempor ut posuere ut, blandit in mauris. Suspendisse commodo sagittis pretium. Nullam.
+
+## Heading 2
+Suspendisse potenti. Donec sit amet porttitor urna. Fusce egestas et elit quis imperdiet. Quisque tempor, metus vel gravida fermentum, odio neque imperdiet justo, vitae sagittis turpis velit vitae velit. Nulla iaculis egestas tellus, non efficitur lorem molestie at. Donec urna sem, pharetra ut nunc non, tempor ullamcorper dolor. Duis fringilla mi eu erat lobortis, ac sagittis ipsum eleifend. Fusce eget rhoncus lorem.
+
+Sed suscipit nisl vel orci scelerisque mattis. Proin ut tortor et purus bibendum pharetra vel elementum dolor. Morbi orci massa, egestas vel dictum quis, maximus id justo. Fusce eu sem consequat, mollis nulla in, mollis nisl. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi at facilisis augue.
+
+
Table or chart caption
+```{r flextable-table-data, ft.align = "left"}
+# Set up some formatting for flextable to be applied to most tables
+my_ft_format <- function(ft) {
+ ft %>%
+ bold(part = "header") %>%
+ bg(bg = "#43358B", part = "header") %>%
+ color(color = "white", part = "header") %>%
+ align(align = "left", part = "header") %>%
+ valign(valign = "center", part = "header") %>%
+ valign(valign = "top", part = "body") %>%
+ colformat_num(big.mark = "") %>%
+ fontsize(size = 12, part = "all") %>%
+ border(border = fp_border_default(color = "#000000", width = 0.5),
+ part = "all")
+}
+
+headings <- list("Table head", "Table head", "Table head", "Table head",
+ "Table head")
+names(headings) <- names(table_data)
+
+flextable(table_data, theme_fun = NULL) %>%
+ my_ft_format() %>%
+ set_header_labels(values = headings) %>%
+ bold(i = nrow(table_data)) %>%
+ align(j = 2, align = "right", part = "body") %>%
+ height(height = 0.236, part = "body") %>%
+ hrule(rule = "atleast", part = "body") %>%
+ width(width = 1.26)
+```
+
+
+
+
Table or chart caption
+```{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
+
+
Figure 1: title ^1,2,\*,\ \*\*\ +\ footnote\ reference^
+```{r chart, fig.width=7.18, fig.height=3.31, fig.cap="Appropriate ALT Text to be added."}
+chart
+```
+
+1. \ \ \ Vivamus molestie massa in quam porttitor viverra. Nulla facilisi. Suspendisse fermentum metus justo, vel elementum ante rutrum eget.
+
+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.
+
+3. \ \ \ Vivamus molestie massa in quam porttitor viverra. Nulla facilisi. Suspendisse fermentum metus justo, vel elementum ante rutrum eget.
+
+
+
+
+### 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.
+
+### Heading 3
+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.
+
+\newpage
+
+# Glossary
+
+**Glossary item name**
+Glossary item description
+
+**Glossary item name**
+Glossary item description
+
+\newpage
+
+# Contact
+**Name, Job title**
+Service
+Phone number
+[phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
+
+**Name, Job title**
+Service
+Phone number
+[phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
+
+For all media enquiries please email [phs.comms@phs.scot](mailto:phs.comms@phs.scot) or call 0131 275 6105.
+
+# Further Information
+Further information and data for this publication are available from the [publication page](https://publichealthscotland.scot/ADD-THE-LINK-TO-YOUR-PUBLICATION-PAGE) on our website.
+
+The next release of this publication will be DD Month YYYY.
+
+# Open data
+Data from this publication is available to download from the [Scottish Health and Social Care Open Data Portal](https://www.opendata.nhs.scot/).
+
+# Rate this publication
+Let us know what you think about this publication via. the link at the bottom of this [publication page](https://publichealthscotland.scot/ADD-THE-LINK-TO-YOUR-PUBLICATION-PAGE) on the PHS website.
+
+\newpage
+
+# Appendices
+## Appendix 1 - Background information
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero.
+
+Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh.
+
+Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. Suspendisse in justo eu magna luctus suscipit. Sed lectus. Integer euismod lacus luctus magna.
+
+\newpage
+
+## Appendix 2 - Publication metadata
+
+**Publication title**
+[Insert publication title]
+
+**Description**
+[Insert publication description]
+
+**Theme**
+[Insert publication theme]
+
+**Topic**
+[Insert publication topic]
+
+**Format**
+[Insert publication format]
+
+**Data source(s)**
+[Insert data source]
+
+**Date that data are acquired**
+DD Month YYYY
+
+**Release date**
+DD Month YYYY
+
+**Frequency**
+[Insert frequency of publication]
+
+**Timeframe of data and timeliness**
+[Insert description of data and timeliness in relation to publication]
+
+**Continuity of data**
+[Insert description of continuity of data in relation to publication]
+
+**Revisions statement**
+[Only to be filled in if there has been a revision made to this publication after initial release. Please include a description of the revision]
+
+**Revisions relevant to this publication**
+
+
+**Concepts and definitions**
+[Insert concepts and definitions in relation to publication]
+
+**Relevance and key uses of the statistics**
+[Insert relevance and key uses for these statistics]
+
+**Accuracy**
+[Insert details about the accuracy of these statistics]
+
+**Completeness**
+[Insert details about the completeness of these statistics]
+
+**Comparability**
+[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://publichealthscotland.scot/accessibility/).
+
+**Coherence and clarity**
+[Insert details about how the coherence and clarity of this publication]
+
+**Value type and unit of measurement**
+[Insert details about the value types and unit of measurement used within this publication]
+
+**Disclosure**
+[Insert details about disclosure levels of risk in relation to this publication]
+
+**Official statistics accreditation**
+Official statistics in development
+
+**UK Statistics Authority assessment**
+[Insert details about the UK Stats Authority assessment of this publication]
+
+**Last published**
+DD Month YYYY
+
+**Next published**
+DD Month YYYY
+
+**Date of first publication**
+DD Month YYYY
+
+**Help email**
+[phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
+
+
+**Date form completed**
+DD Month YYYY
+
+\newpage
+
+## Appendix 3 - Early access details
+
+### 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:
+
+Scottish Government Department of Health and Social Care (DHSC)
+
+NHS board chief executives
+
+NHS board communication leads
+
+### Early access for management information
+
+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
+
+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
+
+### 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 Office for National Statistics '[Five Safes](https://blog.ons.gov.uk/2017/01/27/the-five-safes-data-privacy-at-ons/)' of data privacy.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Translations and other formats are available on request at:
+phs.otherformats@phs.scot 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)
+
diff --git a/inst/rmarkdown/templates/phs-offdev-report/template.yaml b/inst/rmarkdown/templates/phs-offdev-report/template.yaml
new file mode 100644
index 0000000..9387385
--- /dev/null
+++ b/inst/rmarkdown/templates/phs-offdev-report/template.yaml
@@ -0,0 +1,3 @@
+name: PHS Official Stats in Dev Report
+description: Template to produce a PHS official stats in development report document
+create_dir: FALSE
diff --git a/inst/rmarkdown/templates/phs-offdev-summary/skeleton/phs-offdev-summary.docx b/inst/rmarkdown/templates/phs-offdev-summary/skeleton/phs-offdev-summary.docx
new file mode 100644
index 0000000..c991414
Binary files /dev/null and b/inst/rmarkdown/templates/phs-offdev-summary/skeleton/phs-offdev-summary.docx differ
diff --git a/inst/rmarkdown/templates/phs-natstats-summary/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/phs-offdev-summary/skeleton/skeleton.Rmd
similarity index 89%
rename from inst/rmarkdown/templates/phs-natstats-summary/skeleton/skeleton.Rmd
rename to inst/rmarkdown/templates/phs-offdev-summary/skeleton/skeleton.Rmd
index da70e5d..d0841e8 100644
--- a/inst/rmarkdown/templates/phs-natstats-summary/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/phs-offdev-summary/skeleton/skeleton.Rmd
@@ -1,8 +1,7 @@
---
-title: "Title"
output:
word_document:
- reference_docx: "phs-natstats-summary.docx"
+ reference_docx: "phs-offdev-summary.docx"
fig_caption: no
---
@@ -29,7 +28,7 @@ chart <- ggplot(data = chart_data,
scale_x_discrete(limits = c("Apr", "May", "Jun", "July", "Aug", "Sep",
"Oct", "Nov"),
labels = c("Apr", "May", "Jun", "July", "Aug", "Sep",
- "Oct", "Nov")) +
+ "Oct", "Nov")) +
scale_y_continuous(breaks = c(200, 400, 600, 800, 1000, 1200, 1400, 1600),
labels = c("200", "400", "600", "800", "1,000", "1,200",
"1,400", "1,600"),
@@ -62,8 +61,9 @@ chart <- ggplot(data = chart_data,
)
```
+
Publication title
Subtitle
-
A National Statistics release for Scotland
+
An Official statistics in development release for Scotland
Publication date: DD Month YYYY
RESTRICTED STATISTICS: embargoed to 09:30 dd/mm/yyyy
@@ -103,10 +103,14 @@ Name | Role | Number | [phs.generic-team-email@phs.scot](mailto:phs.generic-team
For all media enquiries please email [phs.comms@phs.scot](mailto:phs.comms@phs.scot) or call 0131 275 6105.
# Further information
-Data from this publication are available from the [publication page](https://beta.isdscotland.org/find-publications-and-data/YOUR-PUBLICATION-URL) on our website.
+Data from this publication are available from the [publication page](https://publichealthscotland.scot/publications/YOUR-PUBLICATION-URL) on our website.
Open data from this publication is available from the [Scottish Health and Social Care Open Data platform](https://www.opendata.nhs.scot/).
+Our statistical practice is regulated by the Office for Statistics Regulation (OSR). Official Statistics in development are official statistics which are undergoing a development.
+
+Visit our website for [further information about our statistics and PHS as an Official Statistics producer.](https://publichealthscotland.scot/our-organisation/about-our-statistics/official-statistics/)
+
The next release of this publication will be DD Month YYYY.
Other formats of this publication are available on request by calling 0131 314 5300 or emailing [phs.otherformats@phs.scot](mailto:phs.otherformats@phs.scot).
diff --git a/inst/rmarkdown/templates/phs-offdev-summary/template.yaml b/inst/rmarkdown/templates/phs-offdev-summary/template.yaml
new file mode 100644
index 0000000..8653d2f
--- /dev/null
+++ b/inst/rmarkdown/templates/phs-offdev-summary/template.yaml
@@ -0,0 +1,3 @@
+name: PHS Official Stats in Dev Summary
+description: Template to produce a PHS official stats in development summary document
+create_dir: FALSE
diff --git a/inst/rmarkdown/templates/phs-offstats-report/skeleton/phs-offstats-cover.docx b/inst/rmarkdown/templates/phs-offstats-report/skeleton/phs-offstats-cover.docx
index 3b2e3f2..20c45de 100644
Binary files a/inst/rmarkdown/templates/phs-offstats-report/skeleton/phs-offstats-cover.docx and b/inst/rmarkdown/templates/phs-offstats-report/skeleton/phs-offstats-cover.docx differ
diff --git a/inst/rmarkdown/templates/phs-offstats-report/skeleton/phs-offstats-report.docx b/inst/rmarkdown/templates/phs-offstats-report/skeleton/phs-offstats-report.docx
index 464487d..b462533 100644
Binary files a/inst/rmarkdown/templates/phs-offstats-report/skeleton/phs-offstats-report.docx and b/inst/rmarkdown/templates/phs-offstats-report/skeleton/phs-offstats-report.docx differ
diff --git a/inst/rmarkdown/templates/phs-offstats-report/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/phs-offstats-report/skeleton/skeleton.Rmd
index bc4f73b..ef93545 100644
--- a/inst/rmarkdown/templates/phs-offstats-report/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/phs-offstats-report/skeleton/skeleton.Rmd
@@ -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.",
+ "Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis",
+ "Table Body"
+ ),
+ Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.",
+ "1. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)",
+ "2. Table bullet\n numbered 1 (123)\n a. Table bullet\n numbered 2 (abc)"),
+ Table.Head = c("Table Body text\nIn tristique lobortis sagittis. Phasellus mollis mattis iaculis.",
+ " • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2",
+ " • Table bullet 1\n • Table bullet 1\n ○ Table bullet 2\n ○ Table bullet 2")
+)
+```
+
```{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
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.
-
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.
-
Praesent congue molestie nisi, ut congue dui mattis in. Vivamus vel urna risus. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus.
+
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.
+
Praesent congue molestie nisi, ut congue dui mattis in. **Vivamus vel urna risus**. Donec sed blandit ex. Donec vel aliquam velit, in vestibulum lectus.
\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,48 @@ flextable(table_data, theme_fun = NULL) %>%
-
`r fig_nums("chart")`
+
Table or chart caption
+```{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
+
+
Figure 1: title ^1,2,\*,\ \*\*\ +\ footnote\ reference^
```{r chart, fig.width=7.18, fig.height=3.31, fig.cap="Appropriate ALT Text to be added."}
chart
```
-
-1 Footnote text one.
-
-2 Footnote text two.
+
+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.
+
+
### 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.
### Heading 3
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.
@@ -186,12 +219,12 @@ Glossary item description
\newpage
# Contact
-**Name, Job Title**
+**Name, Job title**
Service
Phone number
[phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
-**Name, Job Title**
+**Name, Job title**
Service
Phone number
[phs.generic-team-email@phs.scot](mailto:phs.generic-team-email@phs.scot)
@@ -278,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]
@@ -289,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**
+Official statistics
-**UK Statistics Authority Assessment**
+**UK Statistics Authority assessment**
[Insert details about the UK Stats Authority assessment of this publication]
**Last published**
@@ -315,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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Translations and other formats are available on request at:
+phs.otherformats@phs.scot 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)
+
diff --git a/inst/rmarkdown/templates/phs-offstats-summary/skeleton/phs-offstats-summary.docx b/inst/rmarkdown/templates/phs-offstats-summary/skeleton/phs-offstats-summary.docx
index c515fba..b0c2b71 100644
Binary files a/inst/rmarkdown/templates/phs-offstats-summary/skeleton/phs-offstats-summary.docx and b/inst/rmarkdown/templates/phs-offstats-summary/skeleton/phs-offstats-summary.docx differ
diff --git a/inst/rmarkdown/templates/phs-offstats-summary/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/phs-offstats-summary/skeleton/skeleton.Rmd
index b0fe687..f99abe1 100644
--- a/inst/rmarkdown/templates/phs-offstats-summary/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/phs-offstats-summary/skeleton/skeleton.Rmd
@@ -1,5 +1,4 @@
---
-title: "Title"
output:
word_document:
reference_docx: "phs-offstats-summary.docx"
@@ -62,8 +61,9 @@ chart <- ggplot(data = chart_data,
)
```
+
Publication title
Subtitle
-
An Official Statistics release for Scotland
+
An Official statistics release for Scotland
Publication date: DD Month YYYY
RESTRICTED STATISTICS: embargoed to 09:30 dd/mm/yyyy
@@ -103,10 +103,14 @@ Name | Role | Number | [phs.generic-team-email@phs.scot](mailto:phs.generic-team
For all media enquiries please email [phs.comms@phs.scot](mailto:phs.comms@phs.scot) or call 0131 275 6105.
# Further information
-Data from this publication are available from the [publication page](https://beta.isdscotland.org/find-publications-and-data/YOUR-PUBLICATION-URL) on our website.
+Data from this publication are available from the [publication page](https://publichealthscotland.scot/publications/YOUR-PUBLICATION-URL) on our website.
Open data from this publication is available from the [Scottish Health and Social Care Open Data platform](https://www.opendata.nhs.scot/).
+Our statistical practice is regulated by the Office for Statistics Regulation (OSR).
+
+Visit our website for [further information about our statistics and PHS as an Official Statistics producer.](https://publichealthscotland.scot/our-organisation/about-our-statistics/official-statistics/)
+
The next release of this publication will be DD Month YYYY.
Other formats of this publication are available on request by calling 0131 314 5300 or emailing [phs.otherformats@phs.scot](mailto:phs.otherformats@phs.scot).
diff --git a/man/phstemplates.Rd b/man/phstemplates.Rd
index d5db9e7..01349f1 100644
--- a/man/phstemplates.Rd
+++ b/man/phstemplates.Rd
@@ -2,6 +2,7 @@
% Please edit documentation in R/phstemplates.R
\docType{package}
\name{phstemplates}
+\alias{phstemplates-package}
\alias{phstemplates}
\title{\code{phstemplates} package}
\description{
@@ -11,3 +12,29 @@ Standard Templates for use in PHS.
See the README on
\href{https://github.com/Public-Health-Scotland/phstemplates#readme}{GitHub}.
}
+\seealso{
+Useful links:
+\itemize{
+ \item \url{https://github.com/Public-Health-Scotland/phstemplates}
+ \item \url{https://public-health-scotland.github.io/phstemplates/}
+ \item Report bugs at \url{https://github.com/Public-Health-Scotland/phstemplates/issues}
+}
+
+}
+\author{
+\strong{Maintainer}: Alan Yeung \email{alan.yeung@phs.scot} (\href{https://orcid.org/0000-0001-5226-3695}{ORCID})
+
+Authors:
+\itemize{
+ \item Anna Price \email{Anna.Price@Statistics.gov.uk}
+ \item Rosalyn Pearson \email{rosalyn.pearson@phs.scot}
+}
+
+Other contributors:
+\itemize{
+ \item Public Health Scotland \email{phs.datascience@phs.scot} [copyright holder]
+ \item James McMahon \email{James.McMahon@phs.scot} (\href{https://orcid.org/0000-0002-5380-2029}{ORCID}) [contributor]
+ \item Ellie Bates \email{Ellie.Bates@phs.scot} [contributor]
+}
+
+}