Thank you for your response
I fixed it, now i am able to copy from excel and paste it in shinyapps.io
steps
- on ui side, copy from excel and paste it in textAreaInput .
textAreaInput(inputId = "mdataset",label = "Dataset",height = 350,width = 700)
- on server side,
observeEvent(input$mdataset,{
if (length(input$mdataset)>0){
aa <- input$mdataset
bb<-data.frame(strsplit( aa[1],"\t|\n"))
colnames(bb) <- c("first_column")
cc <- data.frame(first_column=bb[-(1:8),])
for (i in seq(from = 1, to = nrow(cc), by = ncol(mydata))){
mydata <<- mydata%>%add_row(slno=cc[i,1],study = cc[i+1,1],year = cc[i+2,1],event_exp =as.numeric(cc[i+3,1]),tot_exp =as.numeric(cc[i+4,1]),event_ctrl =as.numeric(cc[i+5,1]),tot_ctrl =as.numeric(cc[i+6,1]),group_name =cc[i+7,1])
}
}
})
for this example, excel table and the mydata dataframe should have these 8 columns, then this code will exactly work
slno, study, year, event_exp, tot_exp, event_ctrl, tot_ctrl, group_name,