R/fun.Rjudge.R

Defines functions fun.Rjudge

Documented in fun.Rjudge

fun.Rjudge <-
function(A,B,symbol)
########################################################
#fun.Rjudge(A,B,symbol)
#######################################################
# version 0.1
# Jul 19, 2012
# Junlong Sun
# return [Output]
#######################################################
#A: matrix
#B: number
#######################################################
# Jul 19, 2012 - v0.1 Create
#######################################################
{

size <- length(A);
Output <- matrix(1, nrow=size, ncol=1)

for(i in 1:size){
	if(symbol=='<'){
		if(A[i] >= B){Output[i] <- 0}
	} else
	if(symbol=='>='){
		if(A[i] < B){Output[i] <- 0} 
	}   
}

#-----------------------------------------------------------------#
## Return results
#-----------------------------------------------------------------#
	return(Output)
#-----------------------------------------------------------------#

}
junlongsun/YPmodel documentation built on Oct. 25, 2020, 2:26 a.m.