-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downloadhandler doesnt respect the paste function. #2
Comments
Hello David, Sharing the observation - Nevertheless, I ran the code with the following updates -
) Code ran without any errors. Important Point to note - I suggest you choose "Run External" and then you should be able to download the file with the file name you have defined in the downloadhandler function. I have tested it and should work for you. Let me know how it goes. I will exclusively make a video as well to show this to you tube viewers so it is easy to understand and they do not take this as a failure on them or an issue per say. I will wait for your response so can close this item. Thanks, have a great day! Regards, |
Thank you so much for identifying the error in the variable.
` I am guessing that you are running the app in the window. `
You are amazing. I was running the app in the window. Now when I run in the
external, it does the job.
I
also have replaced the line `hist(colm())` with
hist(iris[,colm()], breaks = seq(0,max(iris[,colm()], l= input$bins+1)),col
=input$color, main ="Histogram of irish dataset", xlab =
names(iris[colm()]))
which gave me the plot as requied, otherwise I was getting only the empty
plot.
Thank you for the help.
Thanks & regards,
*David Raj Micheal*
Research Scholar,
Department of Statistics, PSPH, MAHE, Manipal.
Mobile: 0 75028 78908
Office : 0820 2922407
…On Mon, May 7, 2018 at 8:47 AM, Abhinav Agrawal ***@***.***> wrote:
Hello David,
Thanks for the details.
Sharing the observation -
Not sure why you have input$var3 in your downloadhandler(). The UI does
not have any input widget with var3 input ID.
Nevertheless, I ran the code with the following updates -
output$down <- downloadHandler(
filename = function() {
paste("iris", input$type, sep=".") *# replace input$var3 by input$type ty
Abi*
},
# content is a function with argument file. content writes the plot to the
device
content = function(file) {
if(input$type == "png") *# replace input$var3 by input$type ty Abi*
png(file) # open the png device
else
pdf(file) # open the pdf device
hist(colm()) # draw the plot
dev.off() # turn the device off
}
)
Code ran without any errors.
Important Point to note -
I am guessing that you are running the app in the window. This would be
the "Run in Window" option of the "Run App" icon in the RStudio. If so,
then for some reason RStudio would pop up the dialog box ignoring the file
name you create using paste and would show the file name as the output ID
of download handler which in your case is "down". It is a known behavior.
I suggest you choose "Run External" and then you should be able to
download the file with the file name you have defined in the
downloadhandler function. I have tested it and should work for you. Let me
know how it goes.
I will exclusively make a video as well to show this to you tube viewers
so it is easy to understand and they do not take this as a failure on them
or an issue per say.
I will wait for your response so can close this item.
Thanks, have a great day!
Regards,
Abi
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOYyRQ_vGLw_U0CO7QsXOkI4rHg1jbhDks5tv7y0gaJpZM4T0DS->
.
|
Youtube video from my channel reproducing and explaining the behavior of download plot |
My ur.R file goes as follows:
and my server.R goes as follows:
When I hit the download button, It shows like the following whereas the file name suppose to be
![image](https://user-images.githubusercontent.com/15086149/39674186-a85d75b6-5165-11e8-9100-bd756d2b43fd.png)
iris.png
. Why this behaviour?I have also tried wrapping arguments of the function,
downdloadHandler
like thisBut this gave the error message as follows.
I am in windows machine Rstudio Version 1.1.442 with R 3.4.4.
The text was updated successfully, but these errors were encountered: