mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-19 05:07:30 +02:00
cleaning
This commit is contained in:
parent
40d95e41c3
commit
ae1c120cd8
4 changed files with 30 additions and 16 deletions
|
|
@ -5,6 +5,6 @@ account: agdamsbo
|
|||
server: shinyapps.io
|
||||
hostUrl: https://api.shinyapps.io/v1
|
||||
appId: 11351429
|
||||
bundleId: 9392352
|
||||
bundleId: 9396834
|
||||
url: https://agdamsbo.shinyapps.io/redcapcast/
|
||||
version: 1
|
||||
|
|
|
|||
|
|
@ -17,21 +17,23 @@ server <- function(input, output, session) {
|
|||
file = NULL
|
||||
)
|
||||
|
||||
dat <- shiny::reactive({
|
||||
ds <- shiny::reactive({
|
||||
shiny::req(input$ds)
|
||||
|
||||
out <- read_input(input$ds$datapath)
|
||||
|
||||
# Saves labels to reapply later
|
||||
# labels <- lapply(out, get_attr)
|
||||
|
||||
out <- out |>
|
||||
## Parses data with readr functions
|
||||
parse_data() |>
|
||||
## Converts logical to factor, which overwrites attributes
|
||||
##
|
||||
## Converts logical to factor, preserving attributes with own function
|
||||
dplyr::mutate(dplyr::across(dplyr::where(is.logical), as_factor))
|
||||
|
||||
out
|
||||
})
|
||||
|
||||
dat <- shiny::reactive({
|
||||
out <- ds()
|
||||
|
||||
if (!is.null(input$factor_vars)) {
|
||||
out <- out |>
|
||||
dplyr::mutate(
|
||||
|
|
@ -42,12 +44,6 @@ server <- function(input, output, session) {
|
|||
)
|
||||
}
|
||||
|
||||
# Old attributes are appended
|
||||
# out <- purrr::imap(out,\(.x,.i){
|
||||
# set_attr(.x,labels[[.i]])
|
||||
# }) |>
|
||||
# dplyr::bind_cols()
|
||||
|
||||
out
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue