Learn R Programming

LotkasLaw (version 0.0.1.0)

LotkasC: Runs the creation of C value in Lotkas Law

Description

Generates Lotkas C value from Equations in Pao(1985)

Usage

LotkasC(N)

Arguments

N
Value N Generated by LotkasN

Value

Value Returned is C.

Examples

Run this code
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (N) 
{
    P <- 20
    increm <- c(1:(P - 1))
    sum <- sum(1/increm^N)
    part1 <- sum
    part2 <- 1/((N - 1) * (P^(N - 1)))
    part3 <- 1/(2 * (P^N))
    part4 <- N/(24 * (P - 1)^(N + 1))
    result <- (part1 + part2 + part3 + part4)
    result <- 1/result
    return(result)
  }

Run the code above in your browser using DataLab