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/geometry.r

View File Source Download File No help file available

Function: circle

Function Description: circle

Calculates points on a

Function Arguments:

ArgumentDefault Value
x
centerc(0,0)
radius5
half"top"

Function Source:

circle=function(x,center=c(0,0),radius=5,half="top")
{
xprime=x-center[1]

yprimesq=radius^2-xprime^2
yprime=numeric()
yprime[yprimesq>=0]=sqrt(yprimesq[yprimesq>=0])

if(half=="bottom") yprime=(-1)*yprime

y=yprime+center[2]
return(y)
}