mdsteiner/ShinyPsych

Create a standardised structure for app guides

Closed this issue · 7 comments

I think we should create a new, user-friendly, standardised structure for specific app guides. I think the current templates dive a bit too quickly into the code. Here is one idea I just came up with.

Something like this:


ShinyBandit

Include Screenshot of the App in action Here

Default Example

  • Run ShinyBandit callApp("Bandit", "run")
  • Show Code: callApp("Bandit", "show")

Description

ShinyBandit is an implementation of a bandit task....In a bandit task, the participant...It has been used in .... relevant citations include...

Common extensions

For a full description of the layout of the code underlying ShinyBandit, click here [ShinyBandit Code Description]. Here is a brief description of some ways you can easily extend ShinyBandit:

Define specific outcome distributions

To define specific outcome distriutions (rather than the default...)

Change number of games

To change the number of games played per participant...

Adjust game display

To show outcomes from all options (not only the selected one), do XXX...

To show positive text in Green and negative text in Red, do XXX...

Additional Examples

  • ShinyBandit with pre-defined outcome distributions callApp("Bandit_ExampleA", "show")
  • ShinyBandit with ... callApp("Bandit_ExampleB", "show")

References

...
...
..

Yes I think that makes sense. I will create the guides and adapt the full code guides we already have.

one note on the adjust game display section: If you'd like to have the possibility to show all options this would involve quite some programming, since the functions as they are now, don't provide this possibility.

Could you, if you haven't already, download the package and run the callApp() function with "show" (e.g. callApp("Bandit", "show")) to test whether on mac it works to open the code in rstudio? for now I just now that it doesn't work on windows.

Don't worry about the adjust game display section, that was just an example. For now, only include extensions that are relatively easy.

and yes I have tried callApp(..."show") and it works great on a mac on rstudio!

ok good to know! then I can point this out in the tutorial as only being a problem on windows.

Yeah there must be a way to fix this for windows...have you tried stackoverflow? I can also try looking later but as I don't have a windows machine I can't check it for accuracy!

I'll try to find a way.
For what I've seen so far, other people came to the conclution that it might be a bug in RStudio. But I'll try to find a way...

fixed it. As far as I understand this RStudio changes the file.edit() function slightly or so. So when I run file.edit(path) directly, it works fine, but when I use utils::file.edit() I receive an error. The solution was to include a file that contains utils::globalVariables(c("file.edit")) in the package. I'll push the changed version when I have the other vignettes.