Topic: Utilities

Topic Description:

Basic R utilities used in many packages and functions, such as date and string manipulations, statistical distributions, geometry of lines and distances. The R package date is required for the two data functions.



File: utilities/utilities.r

View File Source Download File No help file available

Function: fill.1dimension

Function Description: fill.1dimension

Filling a 1D array resulting from tapply. Same as fill.dimension, but for a vector.

Function Arguments:

ArgumentDefault Value
dataarray
class1
fill0

Function Source:

fill.1dimension=function(dataarray,class1,fill=0)
{
if(dim(dataarray)[1] {
m=match(class1,dimnames(dataarray)[[1]])
dataarray=dataarray[m]

names(dataarray)=class1
}

dataarray[is.na(dataarray)]=fill
return(dataarray)
}