catmaply

'catmaply' package for 'R'

https://github.com/verkehrsbetriebezuerich/catmaply

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.8%) to scientific vocabulary

Keywords

heatmaps plots
Last synced: 9 months ago · JSON representation

Repository

'catmaply' package for 'R'

Basic Info
Statistics
  • Stars: 16
  • Watchers: 2
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Topics
heatmaps plots
Created about 6 years ago · Last pushed 12 months ago
Metadata Files
Readme Changelog License

README.md

catmaply

R build status codecov VBZ

Contents

Introduction

A heatmap is a graphical representation of data that uses a system of color-coding to represent different values. Heatmaps are used in various forms of analytics, however, this R package specifically focuses on providing an efficient way for creating interactive heatmaps for categorical data or continuous data that can be grouped into categories.

This package is originally being developed for Verkehrsbetriebe Zürich (VBZ), the public transport operator in the Swiss city of Zurich, to illustrate the utilization of different routes and vehicles during different times of the day. Therefore, it groups utilization data (e.g. persons per m^2) into different categories (e.g. low, medium, high utilization) and illustrates it for certain stops over time in a heatmap.

This package can easily be integrated into a shiny dashboard which supports additional interactions with other plots (e.g. boxplot, histogram, forecast) by using plotly events.

This work is based on the plotly.js engine.

Please submit feature requests

This package is still under active development. If you have features you would like to have added, please submit your suggestions (and bug-reports) at: https://github.com/VerkehrsbetriebeZuerich/catmaply/issues/

News

You can see the most recent changes of the package in NEWS.md.

Installation

To install the latest ("cutting-edge") GitHub version run:

```R

make sure that you have the corrent R Tools installed.

as you might need to build some packages from source

if do not have RTools installed, you can install it with:

install.packages('installr'); install.Rtools() # not tested on windows

or download it from here:

https://cran.r-project.org/bin/windows/Rtools/

in any case, make sure that you select the correct version,

otherwise the installation will fail.

Then you'll need devtools

if (!require('devtools')) install.packages('devtools')

Finally install the package

devtools::install_github('VerkehrsbetriebeZuerich/catmaply') ```

To install the latest available version on cran, run:

R install.packages('catmaply')

And then you may load the package using:

R library("catmaply")

Examples

To get an impression what catmaply does take a look at the following examples.

Simple plot with default options

```R

simple plot

library(catmaply)

example data within catmaply

data("vbz") df <- vbz[[3]]

catmaply( df, x = tripseq, xorder = tripseq, y = stopname, yorder = stopseq, z = occ_category ) ``` The code shown above leads to the following output

More complex plot

catmaply brings many costumizing options for you to get the plot in the shape you want. Also the layout options from Plotly can be used to style the plot.

```R

a bit more complex plot,

using some costumizing options and

layout options from plotly

library(catmaply) library(plotly) library(dplyr)

example data within catmaply

data("vbz") df <- vbz[[3]]

catmaply( df, x = tripid, xorder = tripseq, y = stopname, yorder = stopseq, z = occupancy, categoricalcolorrange = TRUE, categoricalcol = occcategory, hovertemplate = paste( "Time:", departuretime, "
Stop:", stopname, "
Occupancy:", occupancy, "
Occupancy Category:", occ
catname, "
No Of Measurements:", number
ofmeasurements, "" ), legendcol = occcatname ) %>% layout( title = list(text = ""), # adjust hight of plot due to number of stops/observations height = 500 + 10 * max(df$stop_seq), # flip axis and use spikes yaxis = list( autorange = "reversed", showspikes = TRUE, spikedash = "solid", spikethickness = 0.5, spikecolor = "gray" ), # use spikes xaxis = list( showspikes = TRUE, spikedash = "solid", spikethickness = 0.5, spikecolor = "gray", rangeslider = list(thickness = 0.1) ), # horizontal and adjusted legend legend = list( yanchor = "top", y = -0.25, orientation = "h", font = list(size = 9) ) ) ```

The code shown above leads to the following output

Further examples

More step-by-step examples and further descriptions can be found here.

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Owner

  • Name: Verkehrsbetriebe Zürich (VBZ)
  • Login: VerkehrsbetriebeZuerich
  • Kind: organization
  • Email: github@vbz.ch
  • Location: Zurich, Switzerland

GitHub Events

Total
  • Issues event: 3
  • Watch event: 8
  • Delete event: 5
  • Issue comment event: 2
  • Push event: 9
  • Pull request review event: 3
  • Pull request review comment event: 1
  • Pull request event: 4
  • Create event: 4
Last Year
  • Issues event: 3
  • Watch event: 8
  • Delete event: 5
  • Issue comment event: 2
  • Push event: 9
  • Pull request review event: 3
  • Pull request review comment event: 1
  • Pull request event: 4
  • Create event: 4

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 20
  • Total pull requests: 27
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 4
  • Total pull request authors: 2
  • Average comments per issue: 1.15
  • Average comments per pull request: 0.85
  • Merged pull requests: 23
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 months
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • yvesmauron (14)
  • christophbaur (4)
  • npuc1 (1)
  • SimonSchuepbach (1)
Pull Request Authors
  • yvesmauron (26)
  • christophbaur (5)
Top Labels
Issue Labels
enhancement (11) bug (5) documentation (3) refactoring (1) wontfix (1)
Pull Request Labels
documentation (2) enhancement (1) refactoring (1) bug (1)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 305 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
cran.r-project.org: catmaply

Heatmap for Categorical Data using 'plotly'

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 305 Last month
Rankings
Stargazers count: 14.6%
Forks count: 17.8%
Average: 27.5%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 39.9%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4.0 depends
  • dplyr * imports
  • lubridate * imports
  • magrittr * imports
  • plotly * imports
  • rlang * imports
  • tidyverse * imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
  • viridis * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • al-cheb/configure-pagefile-action v1.2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/code-cov.yaml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2-branch composite
  • r-lib/actions/setup-r v2-branch composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action 4.1.4 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite