R/SELbank.R

Defines functions SELbank

Documented in SELbank

SELbank<-function(QB, N, xclude=NULL)
  {
    ###   make random selection of  question bank
    ch = 1:length(QB)

    
    if(!is.null(xclude) & !identical(xclude, 0) )
      {
       ch =  ch[-xclude]

      }

    if(length(ch)<N) N = length(ch)
    
    ran1 = sample(ch, N )

    KBnew = vector(mode='list')

    for(i in 1:N)
      {
        KBnew[[i]] = QB[[ran1[i]]]
      }
    return(KBnew)
    
  }

Try the ProfessR package in your browser

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

ProfessR documentation built on Aug. 21, 2023, 9:07 a.m.