Skip to content

rintukutum/rdonuts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rdonuts


Donuts for R-users :)

inspiRe


Mike Bostock's Block

Description


This package is not a wRapper for D3. It provide useRs to create donuts in existing gRphical space (plot aRea).

Additional resources


  • usefull r-base functions
    • split : Divide into Groups and Reassemble.
    • findInterval : Find Interval Numbers or Indices.
###
### split
require(stats); require(graphics)
n <- 10; nn <- 100
g <- factor(round(n * runif(n * nn)))
x <- rnorm(n * nn) + sqrt(as.numeric(g))
xg <- split(x, g)
boxplot(xg, col = "lavender", notch = TRUE, varwidth = TRUE)
###
### findInterval
x <- 2:18
v <- c(5, 10, 15) # create two bins [5,10) and [10,15)
findInterval(x, v)
# [1] 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3