{"id":14068224,"url":"https://github.com/seabbs/prettypublisher","last_synced_at":"2026-04-14T03:30:18.588Z","repository":{"id":99745052,"uuid":"92515489","full_name":"seabbs/prettypublisher","owner":"seabbs","description":"R package to help in formatting R markdown documents into a publishable format","archived":false,"fork":false,"pushed_at":"2018-07-06T09:05:37.000Z","size":35458,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T13:02:42.542Z","etag":null,"topics":["publishing","r-package","r-stats","reproducible-research"],"latest_commit_sha":null,"homepage":"http://www.samabbott.co.uk/prettypublisher","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seabbs.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-26T13:52:59.000Z","updated_at":"2021-05-19T03:25:43.000Z","dependencies_parsed_at":"2023-07-31T19:45:58.276Z","dependency_job_id":null,"html_url":"https://github.com/seabbs/prettypublisher","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seabbs%2Fprettypublisher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seabbs%2Fprettypublisher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seabbs%2Fprettypublisher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seabbs%2Fprettypublisher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seabbs","download_url":"https://codeload.github.com/seabbs/prettypublisher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240002228,"owners_count":19732165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["publishing","r-package","r-stats","reproducible-research"],"created_at":"2024-08-13T07:06:02.124Z","updated_at":"2026-04-14T03:30:18.543Z","avatar_url":"https://github.com/seabbs.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n# prettypublisher\n\n[![develVersion](https://img.shields.io/badge/devel%20version-0.3.0-blue.svg?style=flat)](https://github.com/seabbs/prettypublisher)\n[![Build Status](https://travis-ci.org/seabbs/prettypublisher.svg?branch=master)](https://travis-ci.org/seabbs/prettypublisher)\n[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/seabbs/prettypublisher?branch=master\u0026svg=true)](https://ci.appveyor.com/project/seabbs/prettypublisher)\n[![codecov](https://codecov.io/gh/seabbs/prettypublisher/branch/master/graph/badge.svg)](https://codecov.io/gh/seabbs/prettypublisher)\n\n`prettypublisher` is an R package that aims to improve your workflow by allowing an easier transition from literate code to a paper draft ready for journal submission. The core functionality is a set of functions that aim to speed up the reporting of descriptive statistics and effect estimates. It also wraps the [captioner](https://github.com/adletaw/captioner) package for figure and table referencing, although you may want to use the functionality provided by [bookdown](https://bookdown.org/yihui/blogdown/). Finally a simple interface is provided for both `pander::pandoc.table` and `knitr::kable`, with some additional features to speed up post production table editing in word, although hopefully this functionality will become redundant as packages provide improved table functionality in word.\n\n## Installation\n\nYou can install prettypublisher from GitHub with:\n\n```{r gh-installation, eval = FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"seabbs/prettypublisher\")\n```\n\nAt this time there are no plans to publish `prettypublisher` to CRAN as some package functionality (for example `pretty_captioner`) adds a captioning function to the users workspace, which is not allowed by CRAN.\n\n## Quick start.\n\nWhilst examples are provided for each function (see [here](https://www.samabbott.co.uk/prettypublisher/reference/index.html) for a list of functions included in the package) the following example, using the `iris` data-set, outlines some of the functionality the package provides.\n\nLoad the `dplyr` for data manipulation, `knitr` for tables, `broom` for model manipulation and `prettypublisher`.\n\n```{r get-packages, message = FALSE}\nlibrary(prettypublisher)\nlibrary(dplyr)\nlibrary(knitr)\nlibrary(broom) \n```\n\nShow the first several rows of the data.\n\n```{r iris-df}\nhead(iris)\n```\n\nAdd some summary statistics for the number of species, make into a table, and add a caption with a reference (`r pretty_tabref(\"per-species\", inline = TRUE)`).\n\n```{r add-sum-stat}\niris %\u003e% \n  count(Species) %\u003e% \n  add_count(wt = n) %\u003e% \n  group_by(Species) %\u003e% \n  mutate(per_species = pretty_percentage(n, nn, digits = 1)) %\u003e% \n  select(-nn) %\u003e% \n  pretty_table(label = \"per-species\",\n               col_names = c(\"Species\", \"Number of samples\", \"Proportion of total (%)\"),\n               caption = \"Breakdown of the number of samples per Species in the iris data-set\",\n               tab_fun = kable)\n```\n\nEstimate the association between Species (limiting the data to `setosa` and `versicolor`) and sepal length using logistic regression.\n\n```{r lm-model}\niris_model \u003c- glm(Species ~ Sepal.Length, \n                  data = filter(iris, Species %in% c(\"setosa\", \"versicolor\")),\n                  family = binomial(\"logit\"),\n                  na.action = na.exclude)\n\nor_df \u003c- iris_model %\u003e% \n  tidy(conf.int = TRUE, \n       conf.level = 0.95,\n       exponentiate = TRUE) %\u003e% \n  mutate(or = pretty_ci(estimate, conf.low, conf.high)) %\u003e%\n  mutate(per_effect = pretty_per_effect(estimate, conf.low, conf.high)) %\u003e% \n  mutate(p_value = format(p.value, digits = 3, scientific = TRUE)) %\u003e% \n  select(term, or, per_effect, p_value) %\u003e% \n  slice(-1) \n\nor_df %\u003e% \n  pretty_table(label = \"glm\",\n               caption = \"Results table for the association between Species and Sepal length.\",\n               col_names = c(\"Variable\", \"OR\", \"Percentage Effect (%)\", \"P value\"))\n```\n\n`r pretty_tabref(\"glm\")` shows commonly reported summary statistics for logistic regressions. For use in line we can also add additional information as follows;\n\n```{r add-ci-inf}\npretty_inline_ci(or_df$or)\n```\n\n## Additional Features\n\nThis package is a work in progress, although the core features and arguements will remain fixed. Additional functions will be added as I find that they are required in my academic work. If there are functions that fit the package aims, that you use regularly when formatting analysis, then please consider adding them to the package via a pull request.\n\n## Docker Development Enviroment\n\nThis package has been developed in docker based on the `rocker/tidyverse` image, to access the  development environment enter the following at the command line (with an active docker daemon running),\n\n```{bash, eval = FALSE}\ndocker pull seabbs/prettypublisher\ndocker run -d -p 8787:8787 -e USER=prettypublisher -e PASSWORD=prettypublisher --name prettypublisher seabbs/prettypublisher\n```\n\nThe rstudio client can be accessed on port `8787` at `localhost` (or your machines ip). The default username is prettypublisher and the default password is prettypublisher.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseabbs%2Fprettypublisher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseabbs%2Fprettypublisher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseabbs%2Fprettypublisher/lists"}