Create data frame of clicks in Shiny from ggplot base layer - r

I've written a function that takes a data frame of specific points and plots them using ggplot, creating a picture. I'd like to be able to take this picture and use it as a GUI for a Shiny app, where users can click anywhere on the picture, add some information from the click, and then append the click's coordinates and information to a data frame (that's originally empty). Ideally this data frame would be able to be downloaded for further analyses.
Is this possible? If so, how do I go about including the functionality in the Shiny app? I'd share code, but the data frame is long and I don't have anything in the Shiny app yet to share. More specific information about the project upon request.

Related

How to re-intitialize reactive render values Shiny?

I work on a Shiny app with multiple reactive variables as well as output objects scattered in numerous tabItems.
The idea behind this app is that on the first page you download a selected dataset, through an action button, that will be used by the entire app. After having created multiple reactive values and output objects when the user will explore the app, I would like to know if there is a simple way to re-initialize the application (reactive variables, output objects) as soon as we download another dataset thanks to the previous action button I have mentionned earlier.
In fact, I want to delete the value of reactive variables and output objects from the memory every time I click on this specific button and DL a new dataset.
I want this app to be the same as it is when I launch my code for the first time.
Regards
Thibaut
I tried to use reactive values a lot but it has to be done for every variables.
Perhaps, there is a simpler way.

Simulating user inputs for R shiny

I have an R shiny app that allows users to upload a dataset, interactively subset it and then save it to the server. I also have several test files that are structured just like the files expected from the future users. I would like to write an automated testing script that uploads one of the datasets, randomly subsets the table (selecting rows in datatable, clicking action buttons) and then clicks a button to save it to the server. The user input to the app should be partly random and I need the clickstream of the user as an output to compare it to the saved dataset.
Is there a way to do this with shinytest or is that just for predefined clickstreams?

Shiny R get access to colleagues without needing to download the data

I have developed a Shiny App that provides some plots which can be filtered and "play" around them. The thing is, I would like to:
Give access to some colleagues. This means that I would like the app to be private, so when someone access the link, a password is needed to enter.
Don't let the user manage the data. I mean, I don't want the user to download the data, so I would like the data be already "there", in a server or something like that. This part should be my responsability, to put the data available for the rest of the colleagues.
I wonder if these things are possible.
For #1 Have a look at shinymanager package, as per this example
For #2 Save the data as a .csv or .rds in the same directory as the app, and load it on visit. You can also utilize shinyjs::hide and shinyjs::show also if you like to make the download buttons invisible

Avoid Flexdashboard pages in same project share objects

I have two reports made in flexdashboards inside the same project.
The only difference is the data source and data wrangling is the same for both. Object names are same because code is really a copy (the only different lines are for data load, filtered by country).
Every chunk has this option to force fresh data always.
r cache=FALSE
Accessing my flexdashboard
Germany.Rmd
renders ok
But if I open the other flexdashboard
France.Rmd
the data and charts are from Germany.
I suppose the objects (df, plot..) having the same name are conflicting even with no cache.
Is there any way of solving this issue to avoid creating a project for every country?

Live Data Visualization using R and mongoDB

My aim is to create a visual data representation of Temperature data coming from a street light via sensors. I am picking that data from the mongoDB database. Basically in my knowledge and experience, I used Shiny And R to show static data graphs from the database, but I am unable to find any way of showing continuously updating data in a moving line chart. I hope you get the picture.
Please refer to this example using node.js(I want to achieve results similar to this but using R)
https://www.youtube.com/watch?v=nauRfoNNEQs
My questions is, is there a way to show real time data visualization in R or I have to necessarily use node.js with plotly?
I'm not sure how "live" you can get the stream, but you might want to look into this:
https://shiny.rstudio.com/reference/shiny/latest/reactivePoll.html
http://shiny.rstudio.com/gallery/reactive-poll-and-file-reader.html

Resources