Skip to content

Instantly share code, notes, and snippets.

PlayTel <- function(x=character){
# load package
require(sound)
# control if the input is a character
if (!is.character(x)) stop("x must be a character")
# split the input
num <- strsplit(as.character(x), "")
#Type:
# (1) wac36 = Weight-for-age charts, birth to 36 months
# (2) lac36 = Length-for-age charts, birth to 36 months
# (3) wlc = Weight-for-recumbent length charts, birth to 36 months
# (4) hac = Head circumference-for-age charts, birth to 36 months
# (5) wsc = Weight-for-stature charts
# (6) wac20 = Weight-for-age charts, 2 to 20 years
# (7) lac20 = Stature-for-age charts, 2 to 20 years
# (8) bac = BMI-for-age charts, 2 to 20 years
#
#Type:
# (1) wac36 = Weight-for-age charts, birth to 36 months
# (2) lac36 = Length-for-age charts, birth to 36 months
# (3) wlc = Weight-for-recumbent length charts, birth to 36 months
# (4) hac = Head circumference-for-age charts, birth to 36 months
# (5) wsc = Weight-for-stature charts
# (6) wac20 = Weight-for-age charts, 2 to 20 years
# (7) lac20 = Stature-for-age charts, 2 to 20 years
# (8) bac = BMI-for-age charts, 2 to 20 years
# (9) bmi.adv = wac20 + lac20 + bac (for pdf export)
library(ggplot2)
# create fictitious data
a <- runif(10)
b <- runif(12)
c <- runif(7)
d <- runif(15)
# data groups
group <- factor(rep(1:4, c(10, 12, 7, 15)))
library(ggplot2)
movies <- movies[1:1000,]
m <- ggplot(movies, aes(x=rating))
m + geom_histogram(binwidth=0.2, colour = "darkgreen", fill = "white", size=1) + geom_point(aes(y = -2), position = position_jitter(height = 0.8), size=1)
library(ggplot2)
movies <- movies[1:1000,]
m <- ggplot(movies, aes(x=rating))
m + geom_histogram(binwidth=0.2, colour = "darkgreen", fill = "white", size=1) + geom_rug(aes(y=-2), position="jitter", sides="b")