File: nkpar.R

package info (click to toggle)
r-cran-blockmodeling 1.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 932 kB
  • sloc: ansic: 2,031; f90: 952; sh: 13; makefile: 5
file content (10 lines) | stat: -rw-r--r-- 212 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
#' @rdname nkpartitions
#' 
#' @export

"nkpar" <-
function(n, k) {
# Author: Chris Andrews <candrews@buffalo.edu>
     sum((-1)^seq(0,k-1) * choose(k, seq(0,k-1)) * (k-seq(0,k-1))^n) / factorial(k)
}