Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.1.0 release #5

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: xlsss
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Version: 0.1.0
Authors@R:
person("First", "Last", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "YOUR-ORCID-ID"))
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ export(make_output_tables)
export(negative_to_c)
export(save_output_tables)
export(table_list_to_tibble)
export(tweak_formatting)
importFrom(magrittr,"%>%")
importFrom(rlang,.data)
29 changes: 13 additions & 16 deletions R/export_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ add_notes_sheet <- function(wb,
openxlsx::setColWidths(
wb,
"Notes",
width = 150,
width = 100,
cols = 2,
ignoreMergedCells = TRUE
)
Expand Down Expand Up @@ -441,16 +441,24 @@ add_data_table <- function(wb,
# Format table headers
openxlsx::addStyle(wb, sheet_name,
rows = header_rows + start_row,
cols = 1:length(table),
style = openxlsx::createStyle(halign = "center", wrapText = TRUE)
cols = 2:length(table),
style = openxlsx::createStyle(halign = "right", wrapText = TRUE)
)

# Format columns
openxlsx::setColWidths(
wb,
sheet_name,
cols = 1:length(table),
width = 20,
cols = 1,
width = "auto",
ignoreMergedCells = TRUE
)

openxlsx::setColWidths(
wb,
sheet_name,
cols = 2:length(table),
width = 12,
ignoreMergedCells = TRUE
)

Expand Down Expand Up @@ -527,15 +535,6 @@ add_data_sheets <- function(wb, table_layout, notes_list) {
return(wb)
}

#' Specific changes to individual sheet formatting
#'
#' @param wb Workbook object
#' @export
tweak_formatting <- function(wb) {

return(wb)
}

#' Create excel tables
#'
#' @param metadata metadata object created by metadata functions
Expand Down Expand Up @@ -569,8 +568,6 @@ make_output_tables <- function(metadata,

wb <- xlsss::add_data_sheets(wb, table_layout, notes_list)

wb <- xlsss::tweak_formatting(wb)

wb
}

Expand Down
18 changes: 17 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/izaak-jephson/xlsss/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/izaak-jephson/xlsss/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of xlsss is to automate production of statistical tables for Social Security Scotland.
The goal of xlsss is to automate production of accessible statistical tables for Social Security Scotland.

## Installation

Expand All @@ -30,3 +30,19 @@ You can install the development version of xlsss from [GitHub](https://github.co
devtools::install_github("ScotGovAnalysis/xlsss")
```

## Getting started

The package comes with a template R script to incorporate into your analysis pipeline. After installation, run:

``` r
xlsss::create_template_output("template_filepath.R")
```
to create the template R script at the specified filepath. This should then be edited to the specifics of your analysis and desired table layout. Instructions are contained within the script itself.

## Contributing to the package

Contributions to the package are very welcome. If you would like to contribute, please fork the directory and open a pull request.

Details of how to do so are available
[here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).

25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
[![R-CMD-check](https://github.com/izaak-jephson/xlsss/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/izaak-jephson/xlsss/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of xlsss is to automate production of statistical tables for
Social Security Scotland.
The goal of xlsss is to automate production of accessible statistical
tables for Social Security Scotland.

## Installation

Expand All @@ -20,3 +20,24 @@ You can install the development version of xlsss from
# install.packages("devtools")
devtools::install_github("ScotGovAnalysis/xlsss")
```

## Getting started

The package comes with a template R script to incorporate into your
analysis pipeline. After installation, run:

``` r
xlsss::create_template_output("template_filepath.R")
```

to create the template R script at the specified filepath. This should
then be edited to the specifics of your analysis and desired table
layout. Instructions are contained within the script itself.

## Contributing to the package

Contributions to the package are very welcome. If you would like to
contribute, please fork the directory and open a pull request.

Details of how to do so are available
[here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).
14 changes: 0 additions & 14 deletions man/tweak_formatting.Rd

This file was deleted.