R Shiny Setting the Folder which is opened in fileInput - r

I am using fileInput in shiny. Now, what I would like to do is to define the folder which is shown based on the fileInput download button. So, e.g. I would like to make sure that the explorer window opens C:/test/test instead of its default library (which could e.g. be C:/test). So, I would like to specify something like
fileInput("PE_TS","",multiple=FALSE,path="C:/test/test)
where path is the path I would want to be shown in the explorer.
How would I do this?

There is a package called shinyFiles
https://github.com/thomasp85/shinyFiles
I haven't tried it myself, but I noticed it has a root parameter, so it might do what you want

Related

Open Specific dir with fileInput Shiny R

Is there any way to open the default Windows Images folder with the fileInput component?
Right now it is opening "My Computer" and I don't want this behaviour.
Yes, I believe this is possible. However, it involves changing your global directory in R. This process is good if you're only going to be using the one directory for a while. To do this:
Go into RStudio
Select "Tools" -> "Global Options.."
You should see something like the image above, then you can select "Browse..." in the red box which will bring up a folder selector, from here you can set your new permanent working directory
Once you've selected your folder, hit "Apply" and then "Ok"
After you've done this when you open your shinyApp with a fileInput the default should be the global path you just set.

R Shiny: Allow download of a plot image through browser with file name

I have a shiny app that renders a plot using ggplot2. In fact, the browser's download image button works too (right click). And, when I download the image it does and displays when I open the file.
Only problem is that the file name to which it downloads is simply called 'untitled'. I want to make the file download to a name. But, I don't want to use the 'download image/plot' button. All examples I see show this option. Want to use built-in browser capability.
Any ideas?
If you don't want to use a button, you could use ggsave inside the function that creates the plot: http://docs.ggplot2.org/0.9.2.1/ggsave.html

How do I add a link to open a pdf file in a new window from my R shiny app?

I can use a() to add a hyperlink in to an external site from my Shiny app,
a("google",href="http://www.google.com")
but how do I make a link to open a pdf (or similar) file? Seems like it should be simple, but I can't find any examples. My question is similar to this one:
Add link to R Shiny Application so link opens in a new browser tab
but I don't know how to structure the href part- where do I put the file to be opened and how do I specify its location? I've tried simple things like http:///C:/Folder/file.pdf or file:///C:/Folder/file.pdf but the file is either not found or wont open.
I am new to shiny and have no html experience, so any suggestions greatly appreciated.
Thanks
Put the pdf file inside the "www" directory (it has to be a subdirectory inside the directory where there are ui.r and server.r )
then you can run your shiny with:
a("click on me",target="_blank",href="myfile.pdf")

How to change working directory via extension in Adobe brackets

Given a file or path - I can use FileUtils (or similar) to work with files. I'd like to be able to alter the current working directory in my extension.
I see in node.js there is process.chdir(directory) but I am unable to access that object.
Is there any other way to change the current working directory.
I am trying to create a simple plugin that when you open the file dialog, the directory your file listing is the same as the currently opened file. The simple implementation being:
MainViewManager.on("currentFileChange", function (e, newFile) {
process.chdir(newFile.parentPath); // This is my FAIL
});
Brackets, like many GUI apps, doesn't use the current working directory very much once it's up and running. So there is probably a different way to accomplish what you're looking for.
When you say...
when you open the file dialog, the directory your file listing is the same as the currently opened file.
...do you mean you want the file tree on the left side of the window to change? If so, try the ProjectManager.openProject() API.
...or do you mean you want to open a file-picker dialog box (like what you see when you choose File > Open in the menu)? If so, you can use FileSystem.showOpenDialog() - the 4th argument is the directory to show when the dialog is first opened.

Change default file icon adding graphical label or similar to it, using Qt library

I want do something like this:
So, add label or graphical label to folders from Qt library, and I don't know what I have to do.
I think, firstly I have to get/take default icon for element and then I suppose, I have to add the label (or PNG) to the icon, or similar, and finally show both.
I'm doing a app similar to DropBox, and files inside a folder have this status label.
Thanks in advance.
Here is a starting point for creating it for Windows:
Creating Shell Extension Handlers
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144067(v=vs.85).aspx
How to Create Icon Handlers
http://msdn.microsoft.com/en-us/library/windows/desktop/cc144122(v=vs.85).aspx
EDIT: Another link - http://www.codeproject.com/Articles/7484/How-to-overlay-an-icon-over-existing-shell-objects
Hope that helps.

Resources