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: inside.rect

Function Description: inside.rect

Determines whether any of the 4 corners of one rectangle are within a second rectangle. Both rectangles are submitted as c(x0,x1,y0,y1). If just one of the corners is inside, it returns true. See insideRectange(), which has a similar name but does something different.

Function Arguments:

ArgumentDefault Value
rect1
rect2

Function Source:

inside.rect=function(rect1,rect2)
{
if(rect1[2] if(rect1[1]>rect2[2]) return(FALSE)
if(rect1[4] if(rect1[3]>rect2[4]) return(FALSE)

return(TRUE)
}