Dashboard, generating column issues

瀏覽次數:37 次
跳到第一則未讀訊息

Monα CheβiL

未讀,
2020年12月11日 清晨5:30:382020/12/11
收件者:Shiny - Web Framework for R

Hello,

I am a student, and I need to create genetics software. According to data of the customer, my software has to be adapted. I would like to create a number of "column" depending of the data size. You can see a part of my code enclosed. I guess dashboard has a problem with "for i in.." but I don't know how I can make it differently... Here number[2]=2 and I would like to create gradientbox and box twice... But maybe another time, with another data number[2] will become number[2]=10 ...

Thanks

tabItem( ########################################################################### appearence
          "Appearence",
          if (is.null(v_appearence)==TRUE){
            gradientBox(
              title = h1("Appearence", align="center"),
              width = 12,
              icon = "fas fa-horse",
              gradientColor = "black",
              boxToolSize = "xs",  
              footer = h4("Any information about appearence is known", align="center")
            )
          } else {
            for (i in 1:number[2]){  #number of appearance  in data
              column (width=12,
                gradientBox(
                  title = h1("Appearence", align = "center"),
                  width = 12,
                  icon = "fas fa-horse",
                  gradientColor = "black",
                  boxToolSize = "xs",
                  footer = h4(Phenotypes[[v_appearence[i],5]], align="center"),
                  h2(Phenotypes[[v_appearence[i],2]],Phenotypes[[v_appearence[i],3]]),
                  h6(em(Phenotypes[[v_appearence[i],6]]),align="right")
                ),
                box(
                  background = "black",
                  width=12,
                  img(src = linka[i], width = 600),
                  align="center"
                )
              )
            }                                                                                            
          }
        ),
回覆所有人
回覆作者
轉寄
0 則新訊息