Giter Club home page Giter Club logo

gghdr's Introduction

gghdr

Package gghdr imports the package hdrcde and provides tools for plotting highest density regions in the ggplot2 framework.

Traditional boxplot

  • central box bounded by Q1 and Q3 representing the interquartile range
  • whiskers extending from Q1 - 1.5(Q3 - Q1) to Q3 + to 1.5(Q3 - Q1), representing 99% coverage for large samples
  • median represented by a horizontal line
#> This is hdrcde 3.3
#> Warning: package 'ggplot2' was built under R version 3.5.2

hdr.boxplot (Existing)

There are different ways to summarize a distribution but the highest density region allows the display of multimodality.

  • Region bounded by the interquartile range is replaced by 50% HDR
  • Region bounded by the whiskers is replaced by the 99% HDR
  • The mode is represented by a horizontal line
library(hdrcde)
hdr.boxplot(faithful$eruptions)

geom_boxplot_hdr (Proposal)

library(ggplot2)
faithful %>% ggplot(aes(y = )) +  geom_hdr_boxplot()

hdr.den (Existing)

  • a density plot
  • the endpoints of each interval in each HDR on the x-axis
  • a straight line showing value of the density at the boundaries of each HDR
hdr.den(faithful$eruptions)

#> $hdr
#>         [,1]     [,2]     [,3]     [,4]
#> 99% 1.323392 2.819361 3.152823 5.282328
#> 95% 1.500534 2.520984 3.500000 5.091921
#> 50% 1.923841 2.025015 3.940445 4.773299
#> 
#> $mode
#> [1] 4.379365
#> 
#> $falpha
#>         1%         5%        50% 
#> 0.06791362 0.15330569 0.36003920
#ggplot(faithful, aes(x=eruptions)) +  geom_density()

gg_hdr (Proposal)

  • geom_density() - to represent the density
  • geom_hdr_rug() - The endpoints of each interval in each HDR on the x-axis
  • geom_hline() - The value of the density at the boundaries of each HDR

gghdr() = geom_density() + geom_hdr_rug() + geom_hline()

library(ggplot2)
faithful %>% ggplot(aes(y = , x = )) +  geom_hdr()

gghdr's People

Contributors

mitchelloharawild avatar sayani07 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.