Three groups issue

on Monday, September 19th, 2022 1:03 | by Silvia Marcato

if(NofGroups==3){
  Count=1
  Control=list()
  Exp=list()
  desc_1 <- tolower(grouped.OMparams[[1]]$desc)
  desc_2 <- tolower(grouped.OMparams[[2]]$desc)
  desc_3 <- tolower(grouped.OMparams[[3]]$desc)
  if(desc_1[1] == desc_2[1]) {
    Control[[1]] = na.omit(grouped.OMparams[[1]])
    Control[[2]] = na.omit(grouped.OMparams[[2]])
    Exp = na.omit(grouped.OMparams[[3]])
    Count = 2
  } else if(desc_1[1] == desc_3[1]) {
    Control[[1]] = na.omit(grouped.OMparams[[1]])
    Control[[2]] = na.omit(grouped.OMparams[[3]])
    Exp = na.omit(grouped.OMparams[[2]])
    Count = 2
  } else {
    Control[[1]] = na.omit(grouped.OMparams[[2]])
    Control[[2]] = na.omit(grouped.OMparams[[3]])
    Exp = na.omit(grouped.OMparams[[1]])
    Count = 2
  }

Given three descriptions, splits them into three variables. Two out of three of these are the same while the other is not: the single set to be compared to the two “identical” sets is emplaced in the Exp list while the other two sets are emplaced in the Control list (the name of these two variables should be replaced).

Print Friendly, PDF & Email

Category: R code

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.