[R] Dependent data validation in R
jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sat Jun 6 15:55:26 CEST 2020
Why are you telling us all of this? Do you have a question about the R language? Dragging in stuff about Excel makes it seem like you just want us to do your work for you.
Try to be more specific about what your difficulty is with R. Here are some links that may help:
 https://cran.r-project.org/web/packages/reprex/index.html (read the vignette)
On June 6, 2020 2:42:49 AM PDT, Manish Mukherjee <manishmukherjee using hotmail.com> wrote:
>Hi All ,
>I need help in creating dependent data validation in R while creating
>an excel workbook
>So i have two columns one has country and other states . I have to
>create the excel workbook in such a way that when i select the one
>specific country , the corresponding states appear in the next column .
>Something similar to dependent input in shiny ,
>Here is the code what i have written
>wb <- createWorkbook()
>df = data.frame("Country"=c("India","US"))
># Add drop-down values "
>writeData(wb, sheet = "list", x = df, startCol = 1)
>writeData(wb, sheet = "list", x = df1, startCol = 2)
>writeData(wb, sheet = "list", x = df2, startCol = 3)
>#Add drop-downs to the column
>dataValidation(wb, "input", col = 1, rows = 2:5, type = "list", value =
>dataValidation(wb, "input", col = 2, rows = 2:5, type = "list", value =
>dataValidation(wb, "input", col = 3, rows = 2:5, type = "list", value =
>saveWorkbook(wb, "dataValidationExample.xlsx", overwrite = TRUE)
>The states should be in single column in exported excel workbook with
>dependent data validation
>Thanks, and Regards
> [[alternative HTML version deleted]]
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.
Sent from my phone. Please excuse my brevity.
More information about the R-help