Learn R Programming

geozoning (version 1.0.0)

datanorm: normalize data coordinates and border

Description

normalize data coordinates and border

Usage

datanorm(data, bd)

Arguments

data

data frame with x and y components

bd

boundary (list with x and y components)

Value

a list with components

dataN

normalized data

boundaryN

normalized boundary

xmin

minimum vaue of x within boundary

xmax

maximum vaue of x within boundary

ymin

minimum vaue of y within boundary

ymax

maximum vaue of y within boundary

Details

normalize boundary between 0 and 1 and data coordinates accordingly

Examples

Run this code
# NOT RUN {
x=runif(100, min=0, max=1)
y=runif(100, min=0.2, max=1.7)
range(x) # not [0,1]
tabData=data.frame(x=x,y=y)
bd=list(x=c(0,0,1,1,0), y=c(0.2,1.7,1.7,0.2,0.2))
res=geozoning:::datanorm(tabData,bd)
apply(res$dataN,2,range)#
# }

Run the code above in your browser using DataLab