Coder Social home page Coder Social logo

gavinfay / decisiontable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ahart1/decisiontable

0.0 1.0 0.0 52.5 MB

This package produces customized decision tables for use in fishery and natural resource management.

License: BSD 2-Clause "Simplified" License

R 100.00%

decisiontable's Introduction

decisiontable

The goal of decisiontable is to combine text-based tables with graphical elements to produce flexible decision table visualizations that convey trade-offs and are easily reproduced. The package leverages bar plots, coloring options, layout choices, and optional summary information to highlight and display trade-offs.

Decision table created using the dataframe option

Installation

You can install the development version of decisiontable from GitHub with:

# install.packages("devtools")
devtools::install_github("ahart1/decisiontable")

Usage

The makeDecisionTable() function is the powerhouse of this package. With it bar plots are used to visually display more traditional text information, coloring can be altered, figure dimensions and layout can be customized, and summary statistics can be calculated and appended to the resulting decision table figure.

Most simply, default function settings can be used to produce a decision table figure where bar chart height coresponds to the printed values along the x-axis of each plot and row and column labels are pulled from the input dataframe. Only the output file name, title, and row headers need be specified to produce an informative decision table. The figure will automatically be stored as a .png file in your current working directory.

library(decisiontable)

# Here is an example dataframe
set.seed(1)
data_df <- matrix(c(abs(rnorm(30,20,sd=5))), ncol = 5, nrow = 6)
colnames(data_df) <- c("Column 1", "Column 2", "Column 3", "Column 4", "Column 5")
rownames(data_df) <- c("Row 1", "Row 2", "Row 3", "Row 4", "Row 5", "Row 6")


# Produce a simple decision table figure using default formatting and minimal input
makeDecisionTable(data = data_df,
                  OutputFileName = "Readme_Fig2",
                  GraphicTitle = "Decision table with \n default formatting",
                  RowHeader = "Row header \n describes type \n of data in rows",
                  ColumnHeader = "Column header describes type of data in columns")
#> [1] "Empty Plot Icon"
#> [1] "Empty Plot Icon"
#> [1] "Empty Plot Icon"
#> [1] "You are done =)"
#> quartz_off_screen 
#>                 2

Decision table created using the dataframe option

To get an introduction to other features of the package, read the introductory vignette.

vignette("decisiontable", package = "decisiontable")

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.