Learn R Programming

zipfR (version 0.6-70)

N-V-Vm.spc: Access Methods for Frequency Spectra (zipfR)

Description

Return the sample size (N.spc), vocabulary size (V.spc) and class sizes (Vm.spc) of the frequency spectrum represented by a spc object. For an expected spectrum with variance information, VV.spc returns the variance of the expected spectrum size and VVm.spc the variances of individual spectrum elements.

Note that these functions are not user-visible. They can be called implicitly through the generic methods N, V, Vm, VV and VVm, applied to an object of type spc.

Usage

# S3 method for spc
N(obj, ...)

# S3 method for spc V(obj, ...)

# S3 method for spc Vm(obj, m, ...)

# S3 method for spc VV(obj, N=NA, ...)

# S3 method for spc VVm(obj, m, N=NA, ...)

Arguments

obj

an object of class spc, representing an observed or expected frequency spectrum

m

positive integer value determining the frequency class \(m\) to be returned (or a vector of such values).

N

not applicable (this argument of the generic method is not used by the implementation for spc objects and must not be specified)

...

additional arguments passed on from generic method will be ignored

Value

N.spc returns the sample size \(N\), V.spc returns the vocabulary size \(V\) (or expected vocabulary size \(E[V]\)), and Vm.spc returns a vector of class sizes \(V_m\) (ot the expected spectrum elements \(E[V_m]\)).

For an expected spectrum with variances, VV.spc returns the variance \(\mathop{Var}[V]\) of the expected vocabulary size, and VVm.spc returns variances \(\mathop{Var}[V_m]\) of the spectrum elements.

Details

VV.spc a VVm.spc will fail if the object obj is not an expected frequency spectrum with variance data.

For an incomplete frequency spectrum, Vm.spc (and VVm.spc) will return NA for all spectrum elements that are not listed in the object (i.e. for m > m.max).

See Also

N, V, Vm, VV, VVm for the generic methods and links to other implementations

spc for details on frequency spectrum objects and links to other relevant functions