Skip to content

Commit

Permalink
add return values and examples to existing functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrace committed Feb 15, 2024
1 parent b3ae9d9 commit 2b2aa35
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 20 deletions.
22 changes: 14 additions & 8 deletions R/standard_panels.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ library(shinyGovstyle)
#' @param repo_name The repository name as listed on GitHub
#' @param ees_publication Whether the source publication is hosted on
#' Explore Education Statistics
#' @param publication_name The source publication name
#' @param publication_stub The source publication stub on
#' @param publication_name The source publication title
#' @param publication_slug The source publication slug on
#' Explore Education Statistics
#' @param alt_href Alternative link to the parent publication
#' (if not hosted on Explore Education Statistics)
Expand All @@ -22,14 +22,20 @@ library(shinyGovstyle)
#' @export
#'
#' @examples
#' # TODO: add basic example of EES publication
#' # TODO: add basic example of non-EES publication
#' support_panel(
#' team_email = "my.team@@education.gov.uk",
#' repo_name = "https://github.com/dfe-analytical-services/my-repo",
#' publication_name = "My publication title",
#' publication_slug = "my-publication-title",
#' form_url = "www.myform.com",
#' cookie_status_output = "cookie_status"
#' )
support_panel <- function(
team_email = "",
repo_name = "",
ees_publication = TRUE,
publication_name = NULL,
publication_stub = "",
publication_slug = "",
alt_href = NULL,
form_url = NULL,
cookie_status_output = "") {
Expand Down Expand Up @@ -115,7 +121,7 @@ support_panel <- function(
href = paste0(
"https://explore-education-statistics.service.gov.uk
/find-statistics/",
publication_stub
publication_slug
),
ifelse(!is.null(publication_name),
publication_name,
Expand All @@ -128,7 +134,7 @@ support_panel <- function(
href = paste0(
"https://explore-education-statistics
.service.gov.uk/find-statistics/",
publication_stub,
publication_slug,
"/data guidance"
),
"data guidance",
Expand All @@ -139,7 +145,7 @@ support_panel <- function(
href = paste0(
"https://explore-education-statistics
.service.gov.uk/find-statistics/",
publication_stub,
publication_slug,
"#explore-data-and-files"
),
"tools to access and interogate the underling data",
Expand Down
4 changes: 3 additions & 1 deletion R/testing.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#' @param subdirs List of sub-directories to
#' recursively search for R scripts to be styled
#'
#' @return
#' @return A vector with TRUE or FALSE for every script checked
#' @export
#'
#' @examples
#' tidy_code()
#' tidy_code(subdirs = c("R", "tests", "data"))
tidy_code <- function(subdirs = c("R", "tests")) {
message("----------------------------------------")
message("App scripts")
Expand Down
27 changes: 18 additions & 9 deletions man/support_panel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions man/tidy_code.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b2aa35

Please sign in to comment.