Giter VIP home page Giter VIP logo

mojtable's Introduction

mojtable

Create statistical tables that meet accessibility requirements

Overview

This package contains functions to create statistical tables that meet accessibility requirements.

For more information on accessibility, please see: https://gss.civilservice.gov.uk/policy-store/accessibility-legislation-what-you-need-to-know/

The MoJ PDC have created a guidance document for making accessible spreadsheets here: https://moj-analytical-services.github.io/PDC-guidance/. This package is intended to make that process easier by enabling the output of an accessible spreadsheet directly from R.

Installation:

devtools::install_github("moj-analytical-services/mojtable")

Available functions

makeExcel

Creates an Excel workbook (.xlsx) containing statistical tables that meet accessibility requirements.

The structure of each table should be created within an R data frame which is then exported as a table to an Excel worksheet. Column names in the data frame will become column names in the final Excel table.

This function accepts a series of lists as arguments. Each list contains a series of values that are used to construct the individual worksheets within the overall workbook. Each list should be the same length and arranged in the order that you want the tabs to appear in the final Excel workbook.

eg. tables[[1]] contains the table for the first tab of the workbook, titles[[1]] contains the title for this table, and so on.

NOTE: This function will output a .XLSX file. You must open this file in Excel and save it in .ODS format before publishing on Gov.Uk

Syntax

makeExcel(
  tables,
  titles,
  subtitles,
  tabnames,
  tablenames,
  filename
  )

Arguments

  • tables: A list of data frames. The data frames will be exported to an Excel worksheet in the same order as they appear in the list. (ie. tables[[1]] will appear in the first tab of the workbook, table[[2]] in the second, and so on)

  • titles: A list of character vectors of length 1. Each list element should contain a single string which will be displayed as the corresponding title of each table.

  • subtitles: A list of character vectors of any length. Each list element should contain a subtitle for the corresponding table. If the vector length of any list element is > 1 then each string within the vector will be displayed on a separate row, allowing for the creation of multi-line subtitles.

  • tabnames: A list of character vectors of length 1. Each list element should contain a name for the corresponding tab of the workbook. Tab names should be short but descriptive and can only contain alphanumeric characters and underscores.

  • tablenames: A list of character vectors of length 1. Each list element should contain a name for the corresponding table. Table names should be short but descriptive and can only contain alphanumeric characters and underscores.

  • filename: A string showing the filename to give to the exported Excel workbook. The filename should include the extension .xlsx

mojtable's People

Contributors

phil-hall-moj avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.