simbg<-function(bg,L){ #bg is a vector of probabilities for A, C, G, T (1x4) #L = length of sites to be simulated seq<-rep(0,L) dna<-c(1,2,3,4) #Numeric codes for DNA seq<-sample(dna,L,replace=T,p=bg) return(seq) }