Web application for the simulation of experimental data

[This article was first published on R on Pablo Bernabeu, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

  Purposes

This open-source, R-based web application is suitable for educational and research purposes in experimental and quantitative sciences. It allows the creation of varied data sets with specified structures, such as between-group and within-participant variables, that can be categorical or continuous. These parameters can be set throughout the various tabs (sections) from the top menu. In the last tab, the data set can be downloaded. The benefits of this application include time-saving and flexibility in the control of parameters.

Guidelines

General guidelines include the following:

  • In the names of variables, it’s recommended only to use alphanumeric characters and underscore signs. The latter can be used to separate characters or words (e.g., variable_name). Different names should be used for each variable.

  • In the levels of categorical variables, alphanumeric, special characters and spaces are allowed.

  • In numeric fields (e.g., ‘Mean’, ‘Standard deviation’, ‘Relative probability [0, 1]’), only numbers and decimal points are allowed.

  • As the data set increases, so does the processing time.

More specific guidelines are available in each section.

?  The web application can be launched here or here.

Screenshot of the Dependent tab (view larger)

Reference

Bernabeu, P., & Lynott, D. (2020). Web application for the simulation of experimental data (Version 1.4). https://github.com/pablobernabeu/Experiment-simulation-app/

Code

This web application was developed in R (R Core Team, 2020). The code is available on Github, where contributions may be made. The initial code for this application was influenced by Section 5.7 (Simulating data for multi-factor designs) in Crump (2017). The R packages used include ‘dplyr’ (Wickham, François, Henry, & Müller, 2018), ‘DT’ (Xie, 2020), ‘flexdashboard’ (Iannone, Allaire, & Borges, 2020), ‘shiny’ (Chang, Cheng, Allaire, Xie, & McPherson, 2020) and ‘stringr’ (Wickham, 2019).

Options for development and local use of the app

Option A) Using local R/RStudio or RStudio Cloud project or Binder RStudio environment

  1. [Step only necessary in R/RStudio] Install the packages in the versions used in the latest release of this application, by running:

    install.packages('devtools')
    library(devtools)
    install_version('dplyr', '1.0.2', 'http://cran.us.r-project.org')
    install_version('DT', '0.15', 'http://cran.us.r-project.org')
    install_version('flexdashboard', '0.5.2', 'http://cran.us.r-project.org')
    install_version('htmltools', '0.5.0', 'http://cran.us.r-project.org')
    install_version('knitr', '1.30', 'http://cran.us.r-project.org')
    install_version('ngram', '3.0.4', 'http://cran.us.r-project.org')
    install_version('purrr', '0.3.4', 'http://cran.us.r-project.org')
    install_version('shiny', '1.5.0', 'http://cran.us.r-project.org')
    install_version('stringr', '1.4.0', 'http://cran.us.r-project.org')
    install_version('tidyr', '1.1.2', 'http://cran.us.r-project.org')
  2. Open the index.Rmd script.

  3. Run the application by clicking on ▶️ Run document at the top left, or by running rmarkdown::run('index.Rmd') in the console.

  4. Click on Open in Browser at the top left.

Option B) Using Dockerfile (see instructions)

Acknowledgements

Thank you to RStudio for the free hosting server used by this application, shinyapps.io.

References

Chang, W., Cheng, J., Allaire, J., Xie, Y., & McPherson, J. (2020). shiny: Web Application Framework for R. R package version 1.4.0. Available at http://CRAN.R-project.org/package=shiny.

Crump, M. J. C. (2017). Programming for Psychologists: Data Creation and Analysis (Version 1.1). https://crumplab.github.io/programmingforpsych/.

Iannone, R., Allaire, J. J., & Borges, B. (2020). Flexdashboard: R Markdown Format for Flexible Dashboards. http://rmarkdown.rstudio.com/flexdashboard.

R Core Team (2020). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.

Wickham, H. (2019). stringr: Simple, Consistent Wrappers for Common String Operations. R package version 1.4.0. https://CRAN.R-project.org/package=stringr.

Wickham, H., François, R., Henry, L., & Müller, K. (2018). dplyr: A Grammar of Data Manipulation. R package version 0.7.6. https://CRAN.R-project.org/package=dplyr.

Xie, Y. (2020). DT: A Wrapper of the JavaScript Library “DataTables”. R package version 0.14. Available at https://CRAN.R-project.org/package=DT.

Contact

To submit any questions or feedback, please post an issue, or email Pablo Bernabeu at [email protected].


To leave a comment for the author, please follow the link and comment on their blog: R on Pablo Bernabeu.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)