Advanced Statistics - Biology 6030

Bowling Green State University, Fall 2017

Lab Exercise for R: Combinatorics

Exercise 1 Combinations:

> choose (5,2)
> binom.test(10, 12, 0.5, alternative="two.sided")
> pascalTri <- function(h) { lapply(0:h, function(i) choose(i, 0:i)) }
> pascalTri(5)

Exercise 2 Permutations:

> install.packages('gtools')
> library(gtools)
> balls <- c('red', 'blue', 'black')
> permutations(n=3,r=2,v=balls)
> bags <- c('green', 'red', 'blue', 'black')
> permutations(n=4, r=3, v=bags, repeats.allowed=T)




last modified: 1/27/17
This material is copyrighted and MAY NOT be used for commercial purposes, 2001-2017 lobsterman.
[ Advanced Statistics Course page | About BIO 6030 | Announcements ]
[ Course syllabus | Exams & Grading | Glossary | Evaluations | Links ]