R/zrcad.R

zrcad <-
function(y,a,b){
zrc <- which((y<a) | (y>b))
if (is.empty(zrc) != TRUE){
for (i in 1:length(zrc)){
	while((y[i]<a[i]) | (y[i]>b[i])){
		if (y[i]>b[i])
			y[i] <- 2*b[i]-y[i]
		if(y[i]<a[i])
			y[i] <- 2*a[i]-y[i]			
	}
}
}
result <- y
return(result)
}

Try the b6e6rl package in your browser

Any scripts or data that you put into this service are public.

b6e6rl documentation built on May 1, 2019, 11:24 p.m.