findRisk {BAMSE}R Documentation

~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

findRisk(visitet, chose = 0, write = F, thres = 0.001, file = NA, iter = 500, snp, only = F, env = 0, log = F,strict = T)

Arguments

visitet ~~Describe visitet here~~
chose ~~Describe chose here~~
write ~~Describe write here~~
thres ~~Describe thres here~~
file ~~Describe file here~~
iter ~~Describe iter here~~
snp ~~Describe snp here~~
only ~~Describe only here~~
env ~~Describe env here~~
log ~~Describe log here~~
strict ~~Describe strict here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1 Description of 'comp1'
comp2 Description of 'comp2'

...

Warning

....

Note

~~further notes~~

~Make other sections like Warning with section{Warning }{....} ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--    or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(visitet,chose=0,write=F,thres=0.001,file=NA,iter=500,snp,only=F,env=0,log=F){
#visitet<-vis1
SNPs<-rep("NA",snp+env)

post<-c()
S2<-1:(snp+env)

if(chose==1){
k<-sorter(visitet,snp1=S2,write=write,file=file,SNPs=SNPs,iter=iter,log=log)
k<-k[-c(1:3)]
return(k)
  }
k<-sorter(visitet,snp1=S2,iter=iter,log=log)
S<-k[2]
SNPs[k[2]]<-k[3]
post<-c(post,k[1])
k<-k[-c(1:3)]
k<-ifelse(k==1,T,F)
the_k<-k

if(chose==2){
k<-sorter(visitet,snp1=S2[-S],k=k,write=write,file=file,SNPs=SNPs,iter=iter,log=log)
k<-k[-c(1:3)]
return(k)
  }
k2<-sorter(visitet,snp1=S2[-S],k=k,SNPs=SNPs,iter=iter,log=log)
try(S<-c(S,k2[2]),T)
try(SNPs[k2[2]]<-k2[3],T)
try(post<-c(post,k2[1]),T)
try(k2<-k2[-c(1:3)],T)
try(k2<-ifelse(k2==1,T,F),T)
try(the_k<-cbind(the_k,k2),T)

if(chose==3){
k<-sorter(visitet,snp1=S2[-S],k=k2,write=write,file=file,SNPs=SNPs,iter=iter,log=log)
k<-k[-c(1:3)]
return(k)
  }
try(k3<-sorter(visitet,snp1=S2[-S],k=k2,iter=iter,log=log),T)
try(post<-c(post,k3[1]),T)
try(SNPs[k3[2]]<-k3[3],T)
try(S<-c(S,k3[2]),T)
try(k3<-k3[-c(1:3)],T)
try(k3<-ifelse(k3==1,T,F),T)
try(the_k<-cbind(the_k,k3),T)

if(chose==4){
k<-sorter(visitet,snp1=S2[-S],k=k3,write=write,file=file,SNPs=SNPs,iter=iter,log=log)
k<-k[-c(1:3)]
return(k)
  }
try(k4<-sorter(visitet,snp1=S2[-S],k=k3,iter=iter,only=only,log=log),T)
try(SNPs[k4[2]]<-k4[3],T)
try(post<-c(post,k4[1]),T)
try(k4<-k4[-c(1:3)],T)
try(k4<-ifelse(k4==1,T,F),T)
try(the_k<-cbind(the_k,k4),T)

#try(print(SNPs),T)
return(list(the_k,post))

  }

[Package BAMSE version 2.0 Index]