![]() ![]() Not sure you can directly write from Shiny to R's environment, but you can for sure save data() as a file on the server. You can then use input$go to query the data: data <- eventReactive(input$go, ) Note that you could also use input$string_input instead of input$goas trigger to update the output while you type the criteria. ![]() String_output() reactive function is now available for output as well as for data query. Output$string_output <-renderText(string_output()) However, it works.įor your first question: # Shiny server function Honestly, I do not understand all of the fundamentals so any suggestions for improvement are welcome. The trick was to define the function saveData, pass the reactive data object to it and assign it to export via <<. Output$data_output <- renderTable(data()) I figured out the solution: library(tibble) Regarding the my second point: I read that one can use <- and <<-, but I could not make it work in a reactive context. I would like to copy the data query result to R's global environment such that I can use it, even after closing the app.I would like store the transformed string_input in an extra local object for further use in the app, that is, I want to pass the string_input to the data query similar to the non-shiny example above.The app takes to list of values supplied by the user as input, transforms it and shows the transformed list as output. I'd like to implement this code in a shiny app: # Shiny user interface ) %>% # enclose words with single quotation marksīase::paste0("carmaker in (". Stringr::str_squish(.) %>% # remove multiple blanksīase::gsub(" ", ",". Mtcars1 % # Create column based on row namesĭplyr::mutate(carmaker = stringr::word(model, 1)) # Create column with first word of column with row namesīase::gsub("+", " ". The following code illustrates this string building and data query process: library(tibble) This is not a requirement for the temporary scratchpad data. The string manipulations are also a crude fail safe to handle entry errors/varieties. If we were to store temporary scratchpad data in the database, SQL Server still outputs transaction logs for all changes to the temporary data as this is the method that SQL Server uses to ensure that the database (even if temporary in nature) has complete data integrity. Unfortunately, dplyr's translation does not appear to be the most efficient/performant solution such that I have to build a string and pass it to the database via sql(). Users are supposed to provide a list of values of interest that are used to filter data stored in a database. Snapshot query results to S3 & download as csv Alternativesĭjango-sql-dashboard: provides an authenticated interface for executing read-only SQL queries directly against your PostgreSQL database, bringing a useful subset of Datasette to Django.I try to build a shiny app that enables users to query data. Sql Explorer is MIT licensed, and pull requests are welcome. The original idea came from Stack Exchange’s Data Explorer, but also owesĬredit to similar projects like Redash and SQL Explorer is inspired by any number of great query and Stability, and the principle of least surprise. SQL Explorer values simplicity, intuitive use, unobtrusiveness, Version control), a basic security model, in-browser pivot tables, and Or Excel files (and even expose queries as API endpoints, if desired),Ĭomes with support for multiple connections, to many different SQLĭatabase types, a schema explorer, query history (e.g. Preview the results in the browser, share links, download CSV, JSON, Quickly write and share SQL queries in a simple, usable SQL editor, It is a Django-based application that youĬan add to an existing Django site, or use as a standalone business SQL Explorer aims to make the flow of data between people fast, ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |