R/chengeMyNeighbour_ToTheLeft_IntoFALSE_ifIamTRUE.R

Defines functions chengeMyNeighbour_ToTheLeft_IntoFALSE_ifIamTRUE

Documented in chengeMyNeighbour_ToTheLeft_IntoFALSE_ifIamTRUE

#' Convert TRUE,TRUE cases embedded in any boolean into TRUE, FALSE
#' 
#' Take boolean vector of any length and convert any two adjacent TRUE, TRUE cases into FALSE,TRUE
#' 
#' @param boolean_vec Boolean vector to be transformed
#' @return Transformed boolean vector with any embedded TRUE,TRUE cases changed to FALSE,TRUE
#' @export   

chengeMyNeighbour_ToTheLeft_IntoFALSE_ifIamTRUE = function(boolean_vec){
  index_duplexes =  create.duplexes(length(boolean_vec))
  for(duplex in 1:nrow(index_duplexes)){
    boolean_vec[index_duplexes[duplex,]] = transformBooleanIntoAnotherBoolean(boolean_vec = boolean_vec[index_duplexes[duplex,]],
                                                                              mode = list(c(T,T),c(F,T)))
  }
  boolean_vec
}
msxakk89/dat documentation built on Aug. 3, 2020, 6:39 p.m.