calc_RIP <- function(repeat_fam) {

#####assign dinucleotide frequencies

  dinucl <- dinucleotideFrequency(repeat_fam) 
  AA <- dinucl[,1]
  AC <- dinucl[,2]
  AG <- dinucl[,3]
  AT <- dinucl[,4]
  CA <- dinucl[,5]
  CC <- dinucl[,6]
  CG <- dinucl[,7]
  CT <- dinucl[,8]
  GA <- dinucl[,9]
  GC <- dinucl[,10]
  GG <- dinucl[,11]
  GT <- dinucl[,12]
  TA <- dinucl[,13]
  TC <- dinucl[,14]
  TG <- dinucl[,15]
  TT <- dinucl[,16]
  
#####Calculate RIP indicies

  RIPindex1 <- TA/AT
  RIPindex2 <- (CA+TG)/(AC+GT)
  RIPindex3 <- (CA+TG)/TA
  RIPindex4 <- (CC+GG)/(TC+GA)
  RIPindex5 <- (CG/(TG+CA))
  RIPindex6 <- (CT+AG)/(TT+AA)
  
  RIP1max <- max(RIPindex1)
  RIP1min <- min(RIPindex1)
  RIP1mean <- mean(RIPindex1)
  RIP1stdev <- sd(RIPindex1)
  RIP2max <- max(RIPindex2)
  RIP2min <- min(RIPindex2)
  RIP2mean <- mean(RIPindex2)
  RIP2stdev <- sd(RIPindex2)
  RIP3max <- max(RIPindex3)
  RIP3min <- min(RIPindex3)
  RIP3mean <- mean(RIPindex3)
  RIP3stdev <- sd(RIPindex3)
  RIP4max <- max(RIPindex4)
  RIP4min <- min(RIPindex4)
  RIP4mean <- mean(RIPindex4)
  RIP4stdev <- sd(RIPindex4)
  RIP5max <- max(RIPindex5)
  RIP5min <- min(RIPindex5)
  RIP5mean <- mean(RIPindex5)
  RIP5stdev <- sd(RIPindex5)
  RIP6max <- max(RIPindex6)
  RIP6min <- min(RIPindex6)
  RIP6mean <- mean(RIPindex6)
  RIP6stdev <- sd(RIPindex6)
  
  names <- c("mean","min","max","stdev")
  RIP1 <- c(RIP1mean,RIP1min,RIP1max,RIP1stdev)
  RIP2 <- c(RIP2mean,RIP2min,RIP2max,RIP2stdev)
  RIP3 <- c(RIP3mean,RIP3min,RIP3max,RIP3stdev)
  RIP4 <- c(RIP4mean,RIP4min,RIP4max,RIP4stdev)
  RIP5 <- c(RIP5mean,RIP5min,RIP5max,RIP5stdev)
  RIP6 <- c(RIP6mean,RIP6min,RIP6max,RIP6stdev)
  
  output <- data.frame(names,RIP1,RIP2,RIP3,RIP4,RIP5,RIP6)
  return(output)
}