<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Applications &amp; dashboards | Pablo Bernabeu</title><link>https://pablobernabeu.github.io/applications-and-dashboards/</link><atom:link href="https://pablobernabeu.github.io/applications-and-dashboards/index.xml" rel="self" type="application/rss+xml"/><description>Applications &amp; dashboards</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-uk</language><copyright>Pablo Bernabeu, 2015—2026. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Email: pcbernabeu@gmail.com. Cookies only used by third-party systems such as [Disqus](https://help.disqus.com/en/articles/1717155-use-of-cookies).</copyright><lastBuildDate>Sun, 01 Feb 2026 00:00:00 +0000</lastBuildDate><image><url>https://pablobernabeu.github.io/img/default_preview_image.jpg</url><title>Applications &amp; dashboards</title><link>https://pablobernabeu.github.io/applications-and-dashboards/</link></image><item><title>Unlock the Lab: Your guide to reading science like a scientist</title><link>https://pablobernabeu.github.io/applications-and-dashboards/unlock-the-lab/</link><pubDate>Sun, 01 Feb 2026 00:00:00 +0000</pubDate><guid>https://pablobernabeu.github.io/applications-and-dashboards/unlock-the-lab/</guid><description>&lt;p>
&lt;a href="https://unlock-the-lab.web.app">&lt;strong>Unlock the Lab&lt;/strong>&lt;/a> is an educational web application designed to develop science literacy by guiding participants through the evaluation of research quality using evidence-based criteria. Rather than passively consuming information, participants actively engage with 48 fictional research scenarios, rating study quality and predicting how their peers will rate the same studies. This peer-anchored design fosters reflective thinking and helps participants calibrate their own judgements against a broader community standard.&lt;/p>
&lt;p>The application is suitable for use in university workshops, open science training events and self-directed learning. It requires no login or prior knowledge, and its browser-based format makes it accessible from any device.&lt;/p>
&lt;div style="width: 100%; height: 800px; margin: 2em 0; border-radius: 8px; overflow: hidden; border: 1px solid #ddd;">
&lt;iframe src="https://unlock-the-lab.web.app"
style="width: 100%; height: 100%; border: none;"
title="Unlock the Lab web application">
&lt;/iframe>
&lt;/div>
&lt;h3 id="how-it-works">How it works&lt;/h3>
&lt;p>&lt;em>Schematic overview; see the text for details.&lt;/em>&lt;/p>
&lt;div class="mermaid">
graph TD
A["Educational introduction:&lt;br/>assessment concepts and&lt;br/>21-term glossary"] --> B["Scenario evaluation:&lt;br/>48 fictional research scenarios"]
B --> C["For each study, two ratings&lt;br/>on a 1-7 scale"]
C --> D["Predict peer consensus score"]
C --> E["Give own quality rating"]
D --> F["Score: 100 minus&lt;br/>prediction error times 12"]
F --> G["Results and reflection:&lt;br/>leaderboard and&lt;br/>analytics dashboard"]
&lt;/div>
&lt;h2 id="educational-objectives">Educational Objectives&lt;/h2>
&lt;p>The application targets several interconnected competencies in scientific reasoning. Participants learn to evaluate research quality using a structured rubric that covers methodology, sample size, data transparency, pre-registration, and publication practices. They also learn to recognise misleading framing, such as sensationalised headlines and clickbait abstracts that misrepresent underlying findings. The scenarios help users identify barriers to knowledge access, including paywalled journals and predatory publishing. A core objective is to practise objective assessment by decoupling conclusions from title framing and focusing instead on the evidence presented. Finally, participants build calibrated consensus skills by comparing their personal ratings against the community average for each study. These objectives are embedded in both the educational content and the task design, ensuring that learning occurs through active participation rather than passive instruction.&lt;/p>
&lt;img src="img/screenshot-rubric.png" alt="Evaluation rubric in Unlock the Lab" style="max-width:100%; border-radius:6px; margin: 1em 0;">
&lt;p style="font-size:0.85em; color:#555; margin-top:-0.5em;">&lt;em>Evaluation rubric presented before the study scenarios and accessible throughout the experience&lt;/em>&lt;/p>
&lt;h2 id="application-structure">Application Structure&lt;/h2>
&lt;p>The workshop unfolds across three main phases. The first is an &lt;strong>educational introduction&lt;/strong> in which participants read background material on how to assess research, covering key concepts in study design, transparency and publication ethics. A glossary of 21 scientific terms with accessible definitions is available throughout and can be consulted at any point. The second phase is &lt;strong>scenario evaluation&lt;/strong>: participants work through 48 fictional research scenarios one at a time, providing two ratings for each study on a 1–7 scale — a prediction of the peer consensus score followed by the participant's own rating. The scenarios span a range of disciplines and vary in quality, methodology and framing. The third phase, &lt;strong>results and reflection&lt;/strong>, invites participants to view their leaderboard position and explore the
&lt;a href="https://unlock-the-lab.web.app/dashboard.html">live analytics dashboard&lt;/a> to see how their ratings compare with the community as a whole.&lt;/p>
&lt;img src="img/screenshot-scenario.png" alt="Research scenario evaluation screen" style="max-width:100%; border-radius:6px; margin: 1em 0;">
&lt;p style="font-size:0.85em; color:#555; margin-top:-0.5em;">&lt;em>Example research scenario with dual rating interface&lt;/em>&lt;/p>
&lt;h2 id="scoring-system">Scoring System&lt;/h2>
&lt;p>Performance is measured by prediction accuracy rather than by agreeing with any predetermined correct answer. Each study is scored as:&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>score = 100 − |predicted_rating − actual_peer_average| × 12&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;p>The multiplier of 12 is a deliberate design choice. Because ratings are on a 1–7 scale, the maximum possible error is 6. Multiplying by 12 means a worst-case prediction still yields a score of 28 (100 − 6 × 12), ensuring participants are never completely penalised for a single poor estimate. A harsher multiplier of roughly 17 would reduce a maximum-error prediction to zero; 12 was chosen as a more forgiving constant that keeps participants engaged throughout the task.&lt;/p>
&lt;p>Scores are capped between 0 and 100. The aggregate score is the sum across all 48 studies, giving a maximum of 4800. This design rewards participants who understand how their peers reason about research quality, rather than those who simply hold strong opinions.&lt;/p>
&lt;h2 id="leaderboard">Leaderboard&lt;/h2>
&lt;p>A real-time leaderboard ranks participants by their aggregate prediction score. Two views are available: the &lt;strong>top 200 of the last 24 hours&lt;/strong> and the &lt;strong>all-time top 200&lt;/strong>. Participants are identified by automatically assigned anonymous usernames (e.g., &amp;quot;Cheerful Penguin&amp;quot;), ensuring data privacy while still enabling a competitive and engaging ranking experience.&lt;/p>
&lt;img src="img/screenshot-leaderboard.png" alt="Leaderboard in Unlock the Lab" style="max-width:100%; border-radius:6px; margin: 1em 0;">
&lt;p style="font-size:0.85em; color:#555; margin-top:-0.5em;">&lt;em>Real-time leaderboard showing prediction accuracy rankings&lt;/em>&lt;/p>
&lt;h2 id="analytics-dashboard">Analytics Dashboard&lt;/h2>
&lt;p>A publicly accessible
&lt;a href="https://unlock-the-lab.web.app/dashboard.html">live analytics dashboard&lt;/a> provides visualisations of the aggregate data collected across all participants. In addition to the leaderboard shown above, the dashboard includes a criterion importance chart showing the degree of importance that participants assigned to each evaluation criterion (title, access, source, theory, methods and data, and conclusion), and a study-level bar chart of mean quality ratings with 95% confidence intervals across all 48 studies. The dashboard is intended both for participants reviewing their own results and for facilitators and researchers interested in population-level patterns.&lt;/p>
&lt;img src="img/screenshot-dashboard-1.png" alt="Top Predictors leaderboard and Criterion Importance chart" style="max-width:100%; border-radius:6px; margin: 1em 0;">
&lt;p style="font-size:0.85em; color:#555; margin-top:-0.5em;">&lt;em>Dashboard section showing the Criterion Importance chart, which displays the average token allocation per evaluation criterion across participants&lt;/em>&lt;/p>
&lt;img src="img/screenshot-dashboard-2.png" alt="Average Quality Ratings by Study chart" style="max-width:100%; border-radius:6px; margin: 1em 0;">
&lt;p style="font-size:0.85em; color:#555; margin-top:-0.5em;">&lt;em>Dashboard section showing mean quality ratings (1–7 scale) with 95% confidence intervals for each of the 48 studies; bars are colour-coded and clickable for detailed study information&lt;/em>&lt;/p>
&lt;h2 id="broader-themes-for-discussion">Broader Themes for Discussion&lt;/h2>
&lt;p>The scenarios in Unlock the Lab are fictional, but the dynamics they expose are real. Several broader themes naturally arise when the application is used in a workshop or classroom setting.&lt;/p>
&lt;p>A question that surfaces in most discussions of science communication is whether scientists are actually rewarded for communicating their work to non-specialist audiences — and the answer depends heavily on institutional context. In many academic systems, promotion and tenure are tied almost exclusively to publication metrics and grant income, leaving little professional incentive for scientists to invest in public engagement. Yet demand for accessible science has grown, particularly in the wake of high-profile controversies over vaccine safety, climate data and pandemic modelling. Some funders now require evidence of public engagement as a condition of grant awards, and frameworks such as the Research Excellence Framework in the United Kingdom have begun to recognise impact beyond academia. Despite these positive developments, a significant gap persists between the stated importance of public outreach and the professional rewards allocated to it.&lt;/p>
&lt;p>Closely related to the question of outreach is a broader set of pressures that shape what research gets produced and how. The quantity and quality of research are governed by incentive structures operating at the level of individuals, institutions and journals. The pressure to publish frequently — sometimes described as publish-or-perish — has been associated with a range of questionable research practices, including selective reporting, inflated effect sizes and the suppression of null results in what is sometimes called the file-drawer problem. Journal impact factors, though widely criticised as crude proxies for article quality, continue to influence hiring and promotion decisions in ways that reward prestige over reproducibility. Funding bodies, which typically favour novelty over replication, have contributed to a research landscape in which confirmation is systematically undervalued. These pressures operate subtly: few researchers consciously intend to distort the scientific record, yet the cumulative effect of individually rational decisions can be a literature that overstates certainty and understates uncertainty. Recognising how these dynamics operate is itself a form of science literacy, and one that the evaluation scenarios in Unlock the Lab are designed to activate.&lt;/p>
&lt;p>It is tempting to trace the open science movement to a gradual, principled awakening, but the reality is considerably less flattering. The push towards greater transparency in research did not emerge from idealism alone. Some of its most consequential catalysts were scandals. The case of Diederik Stapel, the Dutch social psychologist whose fabrication of data across dozens of studies was uncovered in 2011, became one of the most widely discussed episodes of scientific fraud in recent memory. Stapel had built a prolific career on results that were, in some cases, entirely invented, and his exposure prompted sustained reflection both about individual responsibility and about the structural conditions that had made long-term detection so difficult.&lt;/p>
&lt;div>
&lt;div style="position: relative; padding-top: 56.25%; margin-top: 3%; margin-bottom: 4%;">
&lt;iframe src="https://www.youtube.com/embed/WUGh2VWR4JA" frameborder="0" allowfullscreen
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">&lt;/iframe>
&lt;/div>
&lt;/div>
&lt;p>The inquiries that followed identified several systemic vulnerabilities. The absence of raw data sharing, the reluctance of journals to publish replications and the deference that junior researchers typically accord senior colleagues all featured prominently. Similar cases — including those of Marc Hauser in evolutionary psychology, Dirk Smeesters in consumer behaviour and Jens Förster in social cognition — reinforced the argument that individual fraud was symptomatic of broader cultural problems in research. Out of this period of reckoning grew a set of reforms that are now, to varying degrees, embedded in scientific practice: pre-registration of hypotheses and analysis plans, open data and materials repositories, registered reports, large-scale replication efforts such as the Many Labs project, and the emergence of meta-scientific fields dedicated to studying science itself (
&lt;a href="https://doi.org/10.1007/s11948-020-00182-9">Bruton et al., 2020&lt;/a>;
&lt;a href="https://doi.org/10.1371/journal.pone.0263023">Gopalakrishna et al., 2022&lt;/a>;
&lt;a href="https://doi.org/10.1002/job.2623">Kepes et al., 2022&lt;/a>;
&lt;a href="https://doi.org/10.1016/j.rmal.2023.100064">Larsson et al., 2023&lt;/a>;
&lt;a href="https://doi.org/10.3102/0013189X211001356">Makel et al., 2021&lt;/a>;
&lt;a href="https://doi.org/10.1007/s11948-021-00314-9">Xie et al., 2021&lt;/a>). These changes were not imposed from above alone; many were championed by researchers who recognised that the credibility of their own work depended on the credibility of the field as a whole.&lt;/p>
&lt;p>Generative artificial intelligence has since added a further layer of complexity to these debates. The rapid uptake of large language models and other generative AI tools has introduced an entirely new set of questions about transparency and attribution in research. At the level of individual tasks, these tools can assist with drafting, literature synthesis, code generation and data analysis, offering genuine efficiency gains particularly for researchers working in their second or third language. At a systemic level, however, their integration into the research workflow raises concerns that overlap directly with the themes of Unlock the Lab. AI-generated text can produce plausible-sounding but inaccurate citations — a phenomenon sometimes called hallucination — and the persuasive fluency of generated prose can make methodological weaknesses harder to detect. Several journals now require explicit disclosure of AI use in submitted manuscripts, though policies vary widely and enforcement is difficult. Alongside these content-level concerns, large-scale bibliometric analysis of 41.3 million papers has revealed a structural paradox: scientists who engage in AI-augmented research publish more frequently and receive more citations, yet collective AI adoption narrows the range of scientific topics studied and reduces engagement among scientists, with AI-augmented work gravitating towards data-rich areas and appearing to automate established fields rather than pioneer new ones (
&lt;a href="https://doi.org/10.1038/s41586-025-09922-y">Hao et al., 2026&lt;/a>). Perhaps most relevant to science communication is the question of trust: as AI lowers the cost of producing formally credible-looking content, the skills involved in evaluating sources, identifying clickbait and distinguishing rigorous research from superficially persuasive claims become more rather than less important.&lt;/p>
&lt;h2 id="technology-stack">Technology Stack&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Layer&lt;/th>
&lt;th>Technologies&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Frontend&lt;/td>
&lt;td>HTML5, CSS3, JavaScript (ES6+)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Visualisation&lt;/td>
&lt;td>
&lt;a href="https://www.chartjs.org/">Chart.js&lt;/a> 4.4.0&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Build tooling&lt;/td>
&lt;td>
&lt;a href="https://vite.dev/">Vite&lt;/a> 5.4&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Database&lt;/td>
&lt;td>Firebase Realtime Database&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Authentication&lt;/td>
&lt;td>Firebase Authentication (anonymous)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Hosting&lt;/td>
&lt;td>Firebase Hosting&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="source-code-and-contributions">Source Code and Contributions&lt;/h2>
&lt;p>The
&lt;a href="https://github.com/pablobernabeu/Unlock_the_Lab">source code is available on GitHub&lt;/a> under a
&lt;a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International&lt;/a> licence. The application can be extended or adapted via pull requests. Feature requests, bug reports and other suggestions can be submitted as
&lt;a href="https://github.com/pablobernabeu/Unlock_the_Lab/issues">issues&lt;/a>.&lt;/p>
&lt;h2 id="references">References&lt;/h2>
&lt;p>Bruton, S. V., Medlin, M., Brown, M., &amp;amp; Sacco, D. F. (2020). Personal motivations and systemic incentives: Scientists on questionable research practices. &lt;em>Science and Engineering Ethics, 26&lt;/em>(3), 1531–1547. &lt;a href="https://doi.org/10.1007/s11948-020-00182-9">https://doi.org/10.1007/s11948-020-00182-9&lt;/a>&lt;/p>
&lt;p>Gopalakrishna, G., Ter Riet, G., Vink, G., Stoop, I., Wicherts, J. M., &amp;amp; Bouter, L. M. (2022). Prevalence of questionable research practices, research misconduct and their potential explanatory factors: A survey among academic researchers in The Netherlands. &lt;em>PloS ONE, 17&lt;/em>(2), e0263023. &lt;a href="https://doi.org/10.1371/journal.pone.0263023">https://doi.org/10.1371/journal.pone.0263023&lt;/a>&lt;/p>
&lt;p>Hao, Q., Xu, F., Li, Y., &amp;amp; Evans, J. (2026). Artificial intelligence tools expand scientists’ impact but contract science’s focus. &lt;em>Nature, 679&lt;/em>, 1237–1243. &lt;a href="https://doi.org/10.1038/s41586-025-09922-y">https://doi.org/10.1038/s41586-025-09922-y&lt;/a>&lt;/p>
&lt;p>Kepes, S., Keener, S. K., McDaniel, M. A., &amp;amp; Hartman, N. S. (2022). Questionable research practices among researchers in the most research‐productive management programs. &lt;em>Journal of Organizational Behavior, 43&lt;/em>(7), 1190–1208. &lt;a href="https://doi.org/10.1002/job.2623">https://doi.org/10.1002/job.2623&lt;/a>&lt;/p>
&lt;p>Larsson, T., Plonsky, L., Sterling, S., Kytö, M., Yaw, K., &amp;amp; Wood, M. (2023). On the frequency, prevalence, and perceived severity of questionable research practices. &lt;em>Research Methods in Applied Linguistics, 2&lt;/em>(3), 100064. &lt;a href="https://doi.org/10.1016/j.rmal.2023.100064">https://doi.org/10.1016/j.rmal.2023.100064&lt;/a>&lt;/p>
&lt;p>Makel, M. C., Hodges, J., Cook, B. G., &amp;amp; Plucker, J. A. (2021). Both questionable and open research practices are prevalent in education research. &lt;em>Educational Researcher, 50&lt;/em>(8), 493–504. &lt;a href="https://doi.org/10.3102/0013189X211001356">https://doi.org/10.3102/0013189X211001356&lt;/a>&lt;/p>
&lt;p>Xie, Y., Wang, K., &amp;amp; Kong, Y. (2021). Prevalence of research misconduct and questionable research practices: A systematic review and meta-analysis. &lt;em>Science and Engineering Ethics, 27&lt;/em>(4), 41. &lt;a href="https://doi.org/10.1007/s11948-021-00314-9">https://doi.org/10.1007/s11948-021-00314-9&lt;/a>&lt;/p>
&lt;a href='https://unlock-the-lab.web.app/' target='_blank' style="display:inline-block; margin-top: 0.8rem;">
&lt;button style = "background-color: white; color: black; border: 2px solid #196F27; border-radius: 12px;">
&lt;h3 style = "margin-top: 7px !important; margin-left: 9px !important; margin-right: 9px !important;">
&lt;span style="color:#DBE6DA;">&lt;/span> Access web application
&lt;/h3>&lt;/button>
&lt;/a></description></item><item><title>WebVTT caption transcription app</title><link>https://pablobernabeu.github.io/applications-and-dashboards/vtt-transcription-app/</link><pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate><guid>https://pablobernabeu.github.io/applications-and-dashboards/vtt-transcription-app/</guid><description>
&lt;div id="how-it-works" class="section level3">
&lt;h3>How it works&lt;/h3>
&lt;div class="mermaid">
graph TD
A["User uploads WebVTT file (vtt or txt)"] --> B["Regular expressions remove metadata such as timestamps"]
B --> C["Text formatted into a paragraph"]
C --> D["Result displayed on the website"]
D --> E["Download as docx or txt document"]
&lt;/div>
&lt;p>&lt;em>Schematic overview; see the text for details.&lt;/em>&lt;/p>
&lt;p>This open-source, R-based web application converts video captions (subtitles) from the &lt;a href="https://www.w3.org/TR/webvtt1/">Web Video Text Tracks (WebVTT) Format&lt;/a> into plain text. For this purpose, users upload a WebVTT file with the extension &lt;code>.vtt&lt;/code> or &lt;code>.txt&lt;/code> (examples available &lt;a href="https://github.com/pablobernabeu/VTT-Transcription-App/blob/main/assets/Example_subtitles_1.vtt">here&lt;/a> and &lt;a href="https://github.com/pablobernabeu/VTT-Transcription-App/blob/main/assets/Example_subtitles_2.txt">here&lt;/a>).&lt;/p>
&lt;script src="https://emgithub.com/embed-v2.js?target=https%3A%2F%2Fgithub.com%2Fpablobernabeu%2FVTT-Transcription-App%2Fblob%2Fmain%2Fassets%2FExample_subtitles_1.vtt&amp;style=a11y-dark&amp;type=code&amp;showLineNumbers=on&amp;showFileMeta=on&amp;showCopy=on&amp;fetchFromJsDelivr=on">&lt;/script>
&lt;p>&lt;a href="https://osf.io/download/ustmx">&lt;strong>Download VTT file&lt;/strong>&lt;/a>&lt;/p>
&lt;p>When the caption file is uploaded to the web application, metadata such as timestamps are automatically removed, and the text is formatted into a paragraph. The result is displayed on the website, and can be downloaded as &lt;code>.docx&lt;/code> and &lt;code>.txt&lt;/code> documents. Overall, this application serves to improve the accessibility of video captions.&lt;/p>
&lt;p>The data is only available to the user, and is deleted when the website is closed.&lt;/p>
&lt;/div>
&lt;div id="web-application" class="section level2">
&lt;h2>&lt;i class="fa-solid fa-globe">&lt;/i> Web application&lt;/h2>
&lt;p>The application can be used below, or it can be &lt;a href="https://pablo-bernabeu.shinyapps.io/VTT-Transcription-App">opened separately here&lt;/a>.&lt;/p>
&lt;div style="margin-bottom: 25px;">
&lt;div style="position: relative; padding-top: 56.25%; height: 1100px;">
&lt;iframe src="https://pablo-bernabeu.shinyapps.io/VTT-Transcription-App" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
&lt;/iframe>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;div id="programming-details" class="section level2">
&lt;h2>Programming details&lt;/h2>
&lt;p>The &lt;a href="https://github.com/pablobernabeu/VTT-transcription">source code is available on Github&lt;/a>, where the app can be extended via pull requests. Questions and suggestions can be submitted as &lt;a href="https://github.com/pablobernabeu/VTT-transcription/issues">issues&lt;/a> or emailed to &lt;a href="mailto:pcbernabeu@gmail.com" class="email">pcbernabeu@gmail.com&lt;/a>. The licence is &lt;a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International&lt;/a>.&lt;/p>
&lt;p>The core of the application is in the &lt;a href="https://github.com/pablobernabeu/VTT-Transcription-App/blob/main/index.Rmd">index.Rmd&lt;/a> script, which uses ‘&lt;a href="https://stringr.tidyverse.org/articles/regular-expressions.html">regular expressions&lt;/a>’ to process the VTT file.&lt;/p>
&lt;script src="https://emgithub.com/embed-v2.js?target=https%3A%2F%2Fgithub.com%2Fpablobernabeu%2FVTT-Transcription-App%2Fblob%2Fmain%2Findex.Rmd%23L172-L188&amp;style=a11y-dark&amp;type=code&amp;showLineNumbers=on&amp;showFileMeta=on&amp;showCopy=on&amp;fetchFromJsDelivr=on">&lt;/script>
&lt;p>In turn, the script above draws on &lt;a href="https://github.com/pablobernabeu/VTT-Transcription-App/blob/main/assets/VTT-Transcription-App_doc_renderer.Rmd">the one below&lt;/a> to enable the download of &lt;code>.docx&lt;/code> documents. Last, the latter script draws on &lt;a href="https://github.com/pablobernabeu/VTT-Transcription-App/blob/main/assets/VTT-Transcription-App-format-template.docx">this Word template&lt;/a>.&lt;/p>
&lt;script src="https://emgithub.com/embed-v2.js?target=https%3A%2F%2Fgithub.com%2Fpablobernabeu%2FVTT-Transcription-App%2Fblob%2Fmain%2Fassets%2FVTT-Transcription-App_doc_renderer.Rmd%23L1-L13&amp;style=a11y-dark&amp;type=code&amp;showLineNumbers=on&amp;showFileMeta=on&amp;showCopy=on&amp;fetchFromJsDelivr=on">&lt;/script>
&lt;/div></description></item><item><title>Web application for the simulation of experimental data</title><link>https://pablobernabeu.github.io/applications-and-dashboards/experimental-data-simulation/</link><pubDate>Mon, 01 Jun 2020 00:00:00 +0000</pubDate><guid>https://pablobernabeu.github.io/applications-and-dashboards/experimental-data-simulation/</guid><description>
&lt;div style="font-size: 25px; color: #614064; padding-top: 15px; padding-bottom: 10px;">
&lt;i class="fas fa-chalkboard-teacher fa-xs" aria-hidden="true">&lt;/i> &lt;i class="fas fa-university fa-xs" aria-hidden="true">&lt;/i> Purposes
&lt;/div>
&lt;p>This open-source, R-based web application is suitable for educational and research purposes in experimental and quantitative sciences. It allows the &lt;strong>creation of varied data sets with specified structures, such as between-group and within-participant variables, that can be categorical or continuous.&lt;/strong> 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.&lt;/p>
&lt;div id="how-it-works" class="section level3">
&lt;h3>How it works&lt;/h3>
&lt;div class="mermaid">
graph TD
A["Set parameters across tabs"] --> B["Define between-group variables"]
A --> C["Define within-participant variables"]
B --> D["Choose categorical or continuous"]
C --> D
D --> E["Simulated data set"]
E --> F["Build custom summary (penultimate tab)"]
F --> G["Download parameters and data set (last tab)"]
&lt;/div>
&lt;p>&lt;em>Schematic overview; see the text for details.&lt;/em>&lt;/p>
&lt;/div>
&lt;div id="guidelines" class="section level3">
&lt;h3>Guidelines&lt;/h3>
&lt;p>General guidelines include the following:&lt;/p>
&lt;ul>
&lt;li>&lt;p>&lt;strong>In the names of variables&lt;/strong>, it is recommended to use only alphanumeric characters and underscore signs. The latter can be used to separate characters or words (e.g., &lt;em>variable_name&lt;/em>). Different names should be used for each variable.&lt;/p>&lt;/li>
&lt;li>&lt;p>&lt;strong>In the levels of categorical variables&lt;/strong>, alphanumeric, special characters and spaces are allowed.&lt;/p>&lt;/li>
&lt;li>&lt;p>&lt;strong>In numeric fields&lt;/strong> (e.g., ‘Mean’, ‘Standard deviation’, ‘Relative probability [0, 1]’), only numbers and decimal points are allowed.&lt;/p>&lt;/li>
&lt;li>&lt;p>&lt;strong>As the data set increases&lt;/strong>, so does the processing time.&lt;/p>&lt;/li>
&lt;/ul>
&lt;p>More specific guidelines are available in each section.&lt;/p>
&lt;/div>
&lt;div id="the-web-application-can-be-launched-here." class="section level3">
&lt;h3>&lt;i class="fa-solid fa-globe">&lt;/i> The web application can be &lt;a href="https://pablo-bernabeu.shinyapps.io/experimental-data-simulation/">launched here&lt;/a>.&lt;/h3>
&lt;div style="padding-top:8px; padding-bottom:2px; margin-bottom:-20px; color:#665F5F;">
Screenshot of the &lt;em>Dependent&lt;/em> tab (&lt;a href="https://github.com/pablobernabeu/Experimental-data-simulation/raw/master/Screenshot.png">view larger&lt;/a>)
&lt;/div>
&lt;p>&lt;img style="max-width: 800px; display: block; margin-left: auto; margin-right: auto; padding-bottom: 15px;" src="https://github.com/pablobernabeu/Experimental-data-simulation/raw/master/Screenshot.png" />&lt;/p>
&lt;/div>
&lt;div id="reference" class="section level3">
&lt;h3>Reference&lt;/h3>
&lt;p>Bernabeu, P., &amp;amp; Lynott, D. (2020). &lt;em>Web application for the simulation of experimental data&lt;/em> (Version 1.4). &lt;a href="https://github.com/pablobernabeu/Experiment-simulation-app/">https://github.com/pablobernabeu/Experiment-simulation-app/&lt;/a>&lt;/p>
&lt;/div>
&lt;div id="code" class="section level3">
&lt;h3>Code&lt;/h3>
&lt;p>This web application was developed in &lt;a href="https://www.r-project.org/about.html">R&lt;/a> (R Core Team, 2020). The code is &lt;a href="https://github.com/pablobernabeu/Experimental-data-simulation/blob/master/index.Rmd">available on Github&lt;/a>, where contributions may be made. The initial code for this application was influenced by Section 5.7 (&lt;a href="https://crumplab.github.io/programmingforpsych/simulating-and-analyzing-data-in-r.html#simulating-data-for-multi-factor-designs" target="_blank">&lt;em>Simulating data for multi-factor designs&lt;/em>&lt;/a>) in Crump (2017). The R packages used include ‘dplyr’ (Wickham, François, Henry, &amp;amp; Müller, 2018), ‘DT’ (Xie, 2020), ‘flexdashboard’ (Iannone, Allaire, &amp;amp; Borges, 2020), ‘shiny’ (Chang, Cheng, Allaire, Xie, &amp;amp; McPherson, 2020) and ‘stringr’ (Wickham, 2019).&lt;/p>
&lt;/div>
&lt;div id="options-for-development-and-local-use-of-the-app" class="section level3">
&lt;h3>Options for development and local use of the app&lt;/h3>
&lt;div id="option-a-using-local-rrstudio-or-rstudio-cloud-project-or-binder-rstudio-environment" class="section level4">
&lt;h4>Option A) Using local R/RStudio or &lt;a href="https://rstudio.cloud/project/1739958">RStudio Cloud project&lt;/a> or &lt;a href="https://mybinder.org/v2/gh/pablobernabeu/Experimental-data-simulation/master?urlpath=rstudio">Binder RStudio environment&lt;/a>&lt;/h4>
&lt;ol style="list-style-type: decimal">
&lt;li>&lt;p>[Step only necessary in R/RStudio] Install the packages in the versions used in the &lt;a href="https://github.com/pablobernabeu/Experimental-data-simulation/releases">latest release of this application&lt;/a>, by running:&lt;/p>
&lt;pre>&lt;code>install.packages(&amp;#39;devtools&amp;#39;)
library(devtools)
install_version(&amp;#39;dplyr&amp;#39;, &amp;#39;1.0.2&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)
install_version(&amp;#39;DT&amp;#39;, &amp;#39;0.15&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)
install_version(&amp;#39;flexdashboard&amp;#39;, &amp;#39;0.5.2&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)
install_version(&amp;#39;htmltools&amp;#39;, &amp;#39;0.5.0&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)
install_version(&amp;#39;knitr&amp;#39;, &amp;#39;1.30&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)
install_version(&amp;#39;ngram&amp;#39;, &amp;#39;3.0.4&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)
install_version(&amp;#39;purrr&amp;#39;, &amp;#39;0.3.4&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)
install_version(&amp;#39;shiny&amp;#39;, &amp;#39;1.5.0&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)
install_version(&amp;#39;stringr&amp;#39;, &amp;#39;1.4.0&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)
install_version(&amp;#39;tidyr&amp;#39;, &amp;#39;1.1.2&amp;#39;, &amp;#39;http://cran.us.r-project.org&amp;#39;)&lt;/code>&lt;/pre>&lt;/li>
&lt;li>&lt;p>Open the &lt;a href="https://github.com/pablobernabeu/Experimental-data-simulation/blob/master/index.Rmd">index.Rmd&lt;/a> script.&lt;/p>&lt;/li>
&lt;li>&lt;p>Run the application by clicking on &lt;kbd>▶️ Run document&lt;/kbd> at the top left, or by running &lt;code>rmarkdown::run('index.Rmd')&lt;/code> in the console.&lt;/p>&lt;/li>
&lt;li>&lt;p>Click on &lt;kbd>Open in Browser&lt;/kbd> at the top left.&lt;/p>&lt;/li>
&lt;/ol>
&lt;/div>
&lt;div id="option-b-using-dockerfile-see-instructions" class="section level4">
&lt;h4>Option B) Using Dockerfile (&lt;a href="https://github.com/pablobernabeu/Experimental-data-simulation#option-b-using-dockerfile-vsochs-pull-request">see instructions&lt;/a>)&lt;/h4>
&lt;/div>
&lt;/div>
&lt;div id="acknowledgements" class="section level3">
&lt;h3>Acknowledgements&lt;/h3>
&lt;p>Thank you to RStudio for the free hosting server used by this application, &lt;a href="https://www.shinyapps.io/">shinyapps.io&lt;/a>.&lt;/p>
&lt;/div>
&lt;div id="references" class="section level3">
&lt;h3>References&lt;/h3>
&lt;p>Chang, W., Cheng, J., Allaire, J., Xie, Y., &amp;amp; McPherson, J. (2020). shiny: Web Application Framework for R. R package version 1.4.0. Available at &lt;a href="http://CRAN.R-project.org/package=shiny">http://CRAN.R-project.org/package=shiny&lt;/a>.&lt;/p>
&lt;p>Crump, M. J. C. (2017). Programming for Psychologists: Data Creation and Analysis (Version 1.1). &lt;a href="https://crumplab.github.io/programmingforpsych/">https://crumplab.github.io/programmingforpsych/&lt;/a>.&lt;/p>
&lt;p>Iannone, R., Allaire, J. J., &amp;amp; Borges, B. (2020). Flexdashboard: R Markdown Format for Flexible Dashboards. &lt;a href="http://rmarkdown.rstudio.com/flexdashboard">http://rmarkdown.rstudio.com/flexdashboard&lt;/a>.&lt;/p>
&lt;p>R Core Team (2020). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL &lt;a href="https://www.R-project.org/">https://www.R-project.org/&lt;/a>.&lt;/p>
&lt;p>Wickham, H. (2019). stringr: Simple, Consistent Wrappers for Common String Operations. R package version 1.4.0. &lt;a href="https://CRAN.R-project.org/package=stringr">https://CRAN.R-project.org/package=stringr&lt;/a>.&lt;/p>
&lt;p>Wickham, H., François, R., Henry, L., &amp;amp; Müller, K. (2018). dplyr: A Grammar of Data Manipulation. R package version 0.7.6. &lt;a href="https://CRAN.R-project.org/package=dplyr">https://CRAN.R-project.org/package=dplyr&lt;/a>.&lt;/p>
&lt;p>Xie, Y. (2020). DT: A Wrapper of the JavaScript Library “DataTables”. R package version 0.14. Available at &lt;a href="https://CRAN.R-project.org/package=DT">https://CRAN.R-project.org/package=DT&lt;/a>.&lt;/p>
&lt;/div>
&lt;div id="contact" class="section level3">
&lt;h3>Contact&lt;/h3>
&lt;p>To submit any questions or feedback, please post &lt;a href="https://github.com/pablobernabeu/Experimental-data-simulation/issues">an issue&lt;/a>, or email Pablo Bernabeu at &lt;a href="mailto:pcbernabeu@gmail.com">pcbernabeu@gmail.com&lt;/a>.&lt;/p>
&lt;/div></description></item><item><title>Data dashboard: Butterfly species richness in Los Angeles</title><link>https://pablobernabeu.github.io/applications-and-dashboards/butterfly-species-richness-in-la/</link><pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate><guid>https://pablobernabeu.github.io/applications-and-dashboards/butterfly-species-richness-in-la/</guid><description>&lt;a href='https://pablobernabeu.github.io/dashboards/Butterfly-species-richness-in-LA'>
&lt;button style = "background-color: white; color: black; border: 2px solid #196F27; border-radius: 12px;">
&lt;h3 style = "margin-top: 7px !important; margin-left: 9px !important; margin-right: 9px !important;">
&lt;span style="color:#DBE6DA;">&lt;/span> Dashboard
&lt;/h3>&lt;/button>
&lt;/a>
&lt;br>
&lt;br>
&lt;h3 id="how-it-works">How it works&lt;/h3>
&lt;p>&lt;em>Schematic overview; see the text for details.&lt;/em>&lt;/p>
&lt;div class="mermaid">
graph TD
A["Open data from Prudic et al. (2018)"] --> B["iNaturalist (citizen science)"]
A --> C["BioScan (traditional traps)"]
B --> D["Transform, merge, and wrangle in R"]
C --> D
D --> E["Dashboard: butterfly species richness in Los Angeles"]
&lt;/div>
&lt;p>This dashboard presents open data (&lt;a href='https://github.com/jcoliver/bioscan/blob/master/data/iNaturalist-clean-reduced.csv'>iNaturalist&lt;/a> and &lt;a href='https://github.com/jcoliver/bioscan/blob/master/data/BioScanDataComplete.csv'>BioScan&lt;/a>) from
&lt;a href="https://doi.org/10.3390/insects9040186">Prudic et al. (2018)&lt;/a>. In their study, Prudic et al. compared citizen science with traditional methods in the measurement of butterfly populations.&lt;/p>
&lt;p>I developed this dashboard after reproducing the
&lt;a href="https://github.com/jcoliver/bioscan">analyses of the original study&lt;/a> in a
&lt;a href="https://github.com/reprohack/reprohack-hq/blob/master/README.md">Reprohack session&lt;/a>.&lt;/p>
&lt;p>My coding tasks included transforming the data to a long format,&lt;/p>
&lt;pre>&lt;code># There are pseudovariables, that is, observations entered as variables.
# Since most R processes need the tidy format, convert below
# (see https://r4ds.had.co.nz/tidy-data.html). The specific numbers
# found through traps and crowdsourcing methods are preserved.
BioScan = BioScan %&amp;gt;% pivot_longer(
cols = Anthocharis_sara:Vanessa_cardui, names_to = &amp;quot;Species&amp;quot;,
values_to = &amp;quot;Number&amp;quot;, values_drop_na = TRUE
)
# Compare
#str(BioScan)
#str(dat)
# 928 rows now; the result of 29 pseudo-variables being transposed
# into rows, interacting with 32 previous rows, i.e., 29 * 32 = 928.
&lt;/code>&lt;/pre>
&lt;p>merging three data sets,&lt;/p>
&lt;pre>&lt;code># The iNaturalist data set presents a challenge that differs from the
# pseudovariables found above. The number of animals of each species
# must be computed from repeated entries, per site.
iNaturalist = merge(iNaturalist,
iNaturalist %&amp;gt;%
count(species, site, name = 'Number'))
&lt;/code>&lt;/pre>
&lt;p>and, as ever, wrangling with the format of the dashboard pages to preserve the format of a table.&lt;/p>
&lt;pre>&lt;code>Species details {style=&amp;quot;background-color: #FCFCFC;&amp;quot;}
=======================================================================
Column {style=&amp;quot;data-width:100%; position:static; height:1000px;&amp;quot;}
-----------------------------------------------------------------------
&lt;/code>&lt;/pre>
&lt;h3 id="reference">Reference&lt;/h3>
&lt;p>Prudic, K. L., Oliver, J. C., Brown, B. V., &amp;amp; Long, E. C. (2018). Comparisons of citizen science data-gathering approaches to evaluate urban butterfly diversity. &lt;em>Insects, 9&lt;/em>(4), 186. &lt;a href="https://doi.org/10.3390/insects9040186">https://doi.org/10.3390/insects9040186&lt;/a>&lt;/p></description></item><item><title>Dutch modality exclusivity norms</title><link>https://pablobernabeu.github.io/applications-and-dashboards/bernabeu-2018-modalitynorms/</link><pubDate>Mon, 01 Jan 2018 00:00:00 +0000</pubDate><guid>https://pablobernabeu.github.io/applications-and-dashboards/bernabeu-2018-modalitynorms/</guid><description>&lt;a href='https://pablobernabeu.shinyapps.io/Dutch-modality-exclusivity-norms'>
&lt;button style = "background-color: white; color: black; border: 2px solid #196F27; border-radius: 12px;">
&lt;h3 style = "margin-top: 7px !important; margin-left: 9px !important; margin-right: 9px !important;">
&lt;span style="color:#DBE6DA;">&lt;/span> Complete web application &lt;font style='font-size:60%;'>&lt;i>Flexdashboard-Shiny&lt;/i>&lt;/font> &lt;/h3>&lt;/button>&lt;/a>
&lt;br>
&lt;br>
&lt;a href='https://pablobernabeu.github.io/dashboards/Dutch-modality-exclusivity-norms'>
&lt;button style = "background-color: white; color: black; border: 2px solid #4CAF50; border-radius: 12px;">
&lt;h3 style = "margin-top: 7px !important; margin-left: 9px !important; margin-right: 9px !important;">
&lt;span style="color:#DBE6DA;">&lt;/span> Reduced dashboard &lt;font style='font-size:60%;'>&lt;i>Flexdashboard&lt;/i>&lt;/font> &lt;/h3>&lt;/button>&lt;/a> &amp;nbsp;
&lt;br>
&lt;br>
&lt;h3 id="how-it-works">How it works&lt;/h3>
&lt;div class="mermaid">
graph TD
A["Dutch modality exclusivity norms data"] --> B["Flexdashboard front-end (R Markdown)"]
B --> C["Shiny back-end (reactive selection and download)"]
C --> D["Info tab: HTML and CSS text plus rmarkdown output"]
C --> E["Table tab: reactable (colours, bar charts)"]
C --> F["Plot tab: plotly (PCA scatter, tooltips)"]
B --> G["Static Flexdashboard-only version on RPubs (Shiny removed)"]
&lt;/div>
&lt;p>&lt;em>Schematic overview; see the text for details.&lt;/em>&lt;/p>
&lt;p>This web application presents linguistic data over several tabs. The code combines the great front-end of Flexdashboard—based on R Markdown and yielding an unmatched user interface—, with the great back-end of Shiny—allowing users to download sections of data they select, in various formats.&lt;/p>
&lt;ul>
&lt;li>
&lt;p>A nice find was the 'reactable' package, which implements Javascript under the hood to allow the use of colours, bar charts, etc.&lt;/p>
&lt;pre>&lt;code>Auditory = colDef(header = with_tooltip('Auditory Rating',
'Mean rating of each word on the auditory modality across participants.'),
cell = function(value) {
width &amp;lt;- paste0(value / max(table_data$Auditory) * 100, &amp;quot;%&amp;quot;)
value = sprintf(&amp;quot;%.2f&amp;quot;, round(value,2)) # Round to two digits, keeping trailing zeros
bar_chart(value, width = width, fill = '#ff3030')
},
align = 'left'),
&lt;/code>&lt;/pre>
&lt;/li>
&lt;li>
&lt;p>One of the hardest nuts to crack was allowing the full functionality of tables—i.e., scaling to screen, frozen header, and vertical and horizontal scrolling—whilst having tweaked the vertical/horizontal orientation of the dashboard sections. Initial clashes were resolved by adjusting the section's CSS styles&lt;/p>
&lt;pre>&lt;code>Table {#table style=&amp;quot;background-color:#FCFCFC;&amp;quot;}
=======================================================================
Inputs {.sidebar style='position:fixed; padding-top: 65px; padding-bottom:30px;'}
-----------------------------------------------------------------------
&lt;/code>&lt;/pre>
&lt;p>and by also adjusting the reactable settings.&lt;/p>
&lt;pre>&lt;code>renderReactable({
reactable(selected_words(),
defaultSorted = list(cat = 'desc', word = 'asc'),
defaultColDef = colDef(footerStyle = list(fontWeight = &amp;quot;bold&amp;quot;)),
height = 840, striped = TRUE, pagination = FALSE, highlight = TRUE,
&lt;/code>&lt;/pre>
&lt;/li>
&lt;li>
&lt;p>A nice feature, especially suited to Flexdashboard, was the use of different formats across tabs. Whereas the Info tab presents long text using HTML and CSS styling, along with rmarkdown code output, the other tabs rely more strongly on Javascript features, enabled by R packages such as ‘shiny’ and sweetalert (e.g., allowing modal dialogs—pop-ups), reactable and plotly (e.g., allowing information opened by hovering—tooltips).&lt;/p>
&lt;pre>&lt;code>```{r}
# reactive for the word bar
highlighted_properties = reactive(input$highlighted_properties)
renderPlotly({
ggplotly(
ggplot( selected_props(), aes(RC1, RC2, label = as.character(word), color = main,
# Html tags below used for format. Decimals rounded to two.
text = paste0(' ', '&amp;lt;span style=&amp;quot;padding-top:3px; padding-bottom:3px; font-size:2.2em; color:#EEEEEE&amp;quot;&amp;gt;', capitalize(word), '&amp;lt;/span&amp;gt; ', '&amp;lt;br&amp;gt;',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Dominant modality: &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;', main, ' ',
' ', '&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Modality exclusivity: &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;', sprintf(&amp;quot;%.2f&amp;quot;, round(Exclusivity, 2)), '% ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Perceptual strength: &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;', sprintf(&amp;quot;%.2f&amp;quot;, round(Perceptualstrength, 2)),
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Auditory rating: &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;', sprintf(&amp;quot;%.2f&amp;quot;, round(Auditory, 2)), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Haptic rating: &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;', sprintf(&amp;quot;%.2f&amp;quot;, round(Haptic, 2)), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Visual rating: &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;', sprintf(&amp;quot;%.2f&amp;quot;, round(Visual, 2)), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Concreteness (Brysbaert et al., 2014): &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;',
sprintf(&amp;quot;%.2f&amp;quot;, round(concrete_Brysbaertetal2014, 2)), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Number of letters: &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;', letters, ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Number of phonemes (DutchPOND): &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;',
round(phonemes_DUTCHPOND, 2), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Contextual diversity (lg10CD SUBTLEX-NL): &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;',
sprintf(&amp;quot;%.2f&amp;quot;, round(freq_lg10CD_SUBTLEXNL, 2)), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Word frequency (lg10WF SUBTLEX-NL): &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;',
sprintf(&amp;quot;%.2f&amp;quot;, round(freq_lg10WF_SUBTLEXNL, 2)), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Lemma frequency (CELEX): &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;',
sprintf(&amp;quot;%.2f&amp;quot;, round(freq_CELEX_lem, 2)), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Phonological neighbourhood size (DutchPOND): &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;',
round(phon_neighbours_DUTCHPOND, 2), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Orthographic neighbourhood size (DutchPOND): &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;',
round(orth_neighbours_DUTCHPOND, 2), ' ',
'&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;span style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt; Age of acquisition (Brysbaert et al., 2014): &amp;lt;/span&amp;gt;&amp;lt;b style=&amp;quot;color:#EEEEEE&amp;quot;&amp;gt;',
sprintf(&amp;quot;%.2f&amp;quot;, round(AoA_Brysbaertetal2014, 2)), ' ', '&amp;lt;br&amp;gt; '
) ) ) +
geom_text(size = ifelse(selected_props()$word %in% highlighted_properties(), 7,
ifelse(is.null(highlighted_properties()), 3, 2.8)),
fontface = ifelse(selected_props()$word %in% highlighted_properties(), 'bold', 'plain')) +
geom_point(alpha = 0) + # This geom_point helps to colour the tooltip according to the dominant modality
scale_colour_manual(values = colours, drop = FALSE) + theme_bw() + ggtitle('Property words') +
labs(x = 'Varimax-rotated Principal Component 1', y = 'Varimax-rotated Principal Component 2') +
guides(color = guide_legend(title = 'Main&amp;lt;br&amp;gt;modality')) +
theme( plot.background = element_blank(), panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), panel.border = element_blank(),
axis.line = element_line(color = 'black'), plot.title = element_text(size = 14, hjust = .5),
axis.title.x = element_text(colour = 'black', size = 12, margin = margin(15,15,0,15)),
axis.title.y = element_text(colour = 'black', size = 12, margin = margin(0,15,15,5)),
axis.text.x = element_text(size = 8), axis.text.y = element_text(size = 8),
legend.background = element_rect(size = 2), legend.position = 'none',
legend.title = element_blank(),
legend.text = element_text(colour = colours, size = 13) ),
tooltip = 'text'
)
})
# For download, save plot without the interactive 'plotly' part
properties_png = reactive({ ggplot(selected_props(), aes(RC1, RC2, color = main, label = as.character(word))) +
geom_text(show.legend = FALSE, size = ifelse(selected_props()$word %in% highlighted_properties(), 7,
ifelse(is.null(highlighted_properties()), 3, 2.8)),
fontface = ifelse(selected_props()$word %in% highlighted_properties(), 'bold', 'plain')) +
geom_point(alpha = 0) + scale_colour_manual(values = colours, drop = FALSE) + theme_bw() +
guides(color = guide_legend(title = 'Main&amp;lt;br&amp;gt;modality', override.aes = list(size = 7, alpha = 1))) +
ggtitle( paste0('Properties', ' (showing ', nrow(selected_props()), ' out of ', nrow(props), ')') ) +
labs(x = 'Varimax-rotated Principal Component 1', y = 'Varimax-rotated Principal Component 2') +
theme( plot.background = element_blank(), panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), panel.border = element_blank(),
axis.line = element_line(color = 'black'), plot.title = element_text(size = 17, hjust = .5, margin = margin(3,3,7,3)),
axis.title.x = element_text(colour = 'black', size = 12, margin = margin(10,10,2,10)),
axis.title.y = element_text(colour = 'black', size = 12, margin = margin(10,10,10,5)),
axis.text.x = element_text(size = 8), axis.text.y = element_text(size = 8),
legend.background = element_rect(size = 2), legend.position = 'right',
legend.title = element_blank(), legend.text = element_text(size = 15))
})
```
&lt;/code>&lt;/pre>
&lt;p>The only instance in which I drew on JavaScript code outside R packages was to enable tooltips beyond the packages’ limits—for instance, in the sidebar. This JavaScript feature is created at the top of the script, in the head area.&lt;/p>
&lt;pre>&lt;code>&amp;lt;!-- Javascript function to enable a hovering tooltip --&amp;gt;
&amp;lt;script&amp;gt;
$(document).ready(function(){
$('[data-toggle=&amp;quot;tooltip1&amp;quot;]').tooltip();
});
&amp;lt;/script&amp;gt;
&lt;/code>&lt;/pre>
&lt;/li>
&lt;li>
&lt;p>In the sidebar, I added a reactive mean for each variable, complementing the range selector.&lt;/p>
&lt;pre>&lt;code>reactive(cat(paste0('Mean = ',
sprintf(&amp;quot;%.2f&amp;quot;, round(mean(selected_words()$Exclusivity),2)))))
&lt;/code>&lt;/pre>
&lt;/li>
&lt;/ul>
&lt;h2 id="static-version-published-on-rpubs">Static version published on RPubs&lt;/h2>
&lt;p>A reduced,
&lt;a href="https://rpubs.com/pcbernabeu/Dutch-modality-exclusivity-norms">&lt;em>static&lt;/em> version&lt;/a> was also created to increase the availability of the content. Removing some reactivity features allows the dashboard to be published as a standard website (i.e., on a personal website, on
&lt;a href="https://rpubs.com/">RPubs&lt;/a>, etc.), without the need for a back-end Shiny server. Note that this type of website is dubbed 'static', but it can retain multiple interactive features thanks to Javascript-based tools under the hood, allowed by R packages such as &lt;code>leaflet&lt;/code> for maps, &lt;code>DT&lt;/code> for tables, &lt;code>plotly&lt;/code> for plots, etc.&lt;/p>
&lt;p>To create the Flexdashboard-only version departing from the Flexdashboard-Shiny version, I deleted &lt;code>runtime: shiny&lt;/code> from the YAML header, and disabled Shiny reactive inputs and objects, as below.&lt;/p>
&lt;pre>&lt;code>```{r}
# Number of words selected on sidebar
# reactive(cat(paste0('Words selected below: ', nrow(selected_props()))))
```
&lt;/code>&lt;/pre>
&lt;h2 id="reference">Reference&lt;/h2>
&lt;p>Bernabeu, P. (2018). Dutch modality exclusivity norms for 336 properties and 411 concepts [Web application]. Retrieved from &lt;a href="https://pablobernabeu.shinyapps.io/Dutch-Modality-Exclusivity-Norms">https://pablobernabeu.shinyapps.io/Dutch-Modality-Exclusivity-Norms&lt;/a>&lt;/p></description></item><item><title>Modality switch effects emerge early and increase throughout conceptual processing</title><link>https://pablobernabeu.github.io/applications-and-dashboards/bernabeu-etal-2017-modalityswitch/</link><pubDate>Sun, 01 Jan 2017 00:00:00 +0000</pubDate><guid>https://pablobernabeu.github.io/applications-and-dashboards/bernabeu-etal-2017-modalityswitch/</guid><description>&lt;h3 id="how-it-works">How it works&lt;/h3>
&lt;p>&lt;em>Schematic overview; see the text for details.&lt;/em>&lt;/p>
&lt;div class="mermaid">
graph TD
A["EEG-ERP data from word comprehension experiment"] --> B["ERP plots spanning 800 ms of word processing"]
B --> C["Groups of participants"]
C --> D["Individual participants"]
D --> E["Brain areas"]
E --> F["Electrodes"]
B --> G["Download HD plots, view 95% confidence intervals"]
&lt;/div>
&lt;a href='https://pablobernabeu.shinyapps.io/ERP-waveform-visualization_CMS-experiment/'>
&lt;button style = "background-color: white; color: black; border: 2px solid #4CAF50; border-radius: 12px;">
&lt;h3 style = "margin-top: 7px !important; margin-left: 9px !important; margin-right: 9px !important;">
&lt;span style="color:#DBE6DA;">&lt;/span> Web application &lt;/h3>&lt;/button>&lt;/a> &amp;nbsp;
&lt;br>
&lt;br>
&lt;p>&lt;strong>Content&lt;/strong>&lt;/p>
&lt;p>The data are from a psychology experiment on the comprehension of words, in which electroencephalographic (EEG) responses were measured. The data are presented in plots spanning 800 milliseconds (the duration of word processing). The aim of this Shiny app is to facilitate the exploration of the data by researchers and the public. Users can delve into the different sections of the data. In a hierarchical order, these sections are groups of participants, individual participants, brain areas, and electrodes.&lt;/p>
&lt;p>&lt;strong>Shiny apps in science&lt;/strong>&lt;/p>
&lt;p>By creating this app, I tried to reach beyond the scope of current &lt;em>open science&lt;/em>, which is often confined to files shared on data repositories. I believe that Shiny apps will become general practice in science within a few years (
&lt;a href="http://www.research.lancs.ac.uk/portal/en/activities/presenting-data-interactively-online-using-r-shiny%28c9ce06ac-987e-4141-9121-016f6ee6d16b%29.html">see blog post or slides for more information&lt;/a>).&lt;/p>
&lt;p>&lt;strong>Technical details&lt;/strong>&lt;/p>
&lt;p>I used tabs on the upper area of the application page to avoid cramming the side bar with widgets. I adjusted the appearance of these tabs, and by means of 'reactivity' conditions, modified the inputs in the side bar depending on the active tab.&lt;/p>
&lt;pre>&lt;code>mainPanel(
tags$style(HTML('
.tabbable &amp;gt; .nav &amp;gt; li &amp;gt; a {background-color:white; color:#3E454E}
.tabbable &amp;gt; .nav &amp;gt; li &amp;gt; a:hover {background-color:#002555; color:white}
.tabbable &amp;gt; .nav &amp;gt; li[class=active] &amp;gt; a {background-color:#ECF4FF; color:black}
.tabbable &amp;gt; .nav &amp;gt; li[class=active] &amp;gt; a:hover {background-color:#E7F1FF; color:black}
')),
tabsetPanel(id='tabvals',
tabPanel(value=1, h4(strong('Group &amp;amp; Electrode')), br(), plotOutput('plot_GroupAndElectrode'),
h5(a(strong('See plots with 95% Confidence Intervals'), href='https://osf.io/2tpxn/',
target='_blank'), style='text-decoration: underline;'),
downloadButton('downloadPlot.1', 'Download HD plot'), br(), br(),
# EEG montage
img(src='https://preview.ibb.co/n7qiYR/EEG_montage.png', height=500, width=1000)),
tabPanel(value=2, h4(strong('Participant &amp;amp; Area')), br(), plotOutput('plot_ParticipantAndLocation'),
h5(a(strong('See plots with 95% Confidence Intervals'), href='https://osf.io/86ch9/',
target='_blank'), style='text-decoration: underline;'),
downloadButton('downloadPlot.2', 'Download HD plot'), br(), br(),
# EEG montage
img(src='https://preview.ibb.co/n7qiYR/EEG_montage.png', height=500, width=1000)),
tabPanel(value=3, h4(strong('Participant &amp;amp; Electrode')), br(), plotOutput('plot_ParticipantAndElectrode'),
br(), downloadButton('downloadPlot.3', 'Download HD plot'), br(), br(),
# EEG montage
img(src='https://preview.ibb.co/n7qiYR/EEG_montage.png', height=500, width=1000)),
tabPanel(value=4, h4(strong('OLD Group &amp;amp; Electrode')), br(), plotOutput('plot_OLDGroupAndElectrode'),
h5(a(strong('See plots with 95% Confidence Intervals'), href='https://osf.io/dvs2z/',
target='_blank'), style='text-decoration: underline;'),
downloadButton('downloadPlot.4', 'Download HD plot'), br(), br(),
# EEG montage
img(src='https://preview.ibb.co/n7qiYR/EEG_montage.png', height=500, width=1000))
),
&lt;/code>&lt;/pre>
&lt;p>The data set was fairly large, considering the fact that it's hosted with the free plan. In order to lighten the processing, I split the data into various files, reducing the total size. Furthermore, I outsourced a particularly heavy set of plots (those with Confidence Intervals) to PDF files, to which I linked in the app.&lt;/p>
&lt;pre>&lt;code>h5(a(strong('See plots with 95% Confidence Intervals'), href='https://osf.io/dvs2z/',
target='_blank'), style='text-decoration: underline;'),
&lt;/code>&lt;/pre>
&lt;p>I also used web links to the published paper and raw data, as well as to the &lt;em>server&lt;/em> and &lt;em>ui&lt;/em> scripts. These files, along with the data, are publicly available
&lt;a href="https://osf.io/97unm/">in this repository&lt;/a>; they may be accessed within the &amp;quot;Files&amp;quot; section, by opening the folders &amp;quot;ERPs&amp;quot; -&amp;gt; &amp;quot;Analyses of ERPs averaged across trials&amp;quot; -&amp;gt; &amp;quot;Shiny app&amp;quot;.&lt;/p>
&lt;p>Another feature I added was the download button.&lt;/p>
&lt;pre>&lt;code># From server.R script
spec_title = paste0('ERP waveforms for ', input$var.Group, ' Group, Electrode ', input$var.Electrodes.1, ' (negative values upward; time windows displayed)')
plot_GroupAndElectrode = ggplot(df2, aes(x=time, y=-microvolts, color=condition)) +
geom_rect(xmin=160, xmax=216, ymin=7.5, ymax=-8, color = 'grey75', fill='black', alpha=0, linetype='longdash') +
geom_rect(xmin=270, xmax=370, ymin=7.5, ymax=-8, color = 'grey75', fill='black', alpha=0, linetype='longdash') +
geom_rect(xmin=350, xmax=550, ymin=8, ymax=-7.5, color = 'grey75', fill='black', alpha=0, linetype='longdash') +
geom_rect(xmin=500, xmax=750, ymin=7.5, ymax=-8, color = 'grey75', fill='black', alpha=0, linetype='longdash') +
geom_line(size=1, alpha = 1) + scale_linetype_manual(values=colours) +
scale_y_continuous(limits=c(-8.38, 8.3), breaks=seq(-8,8,by=1), expand = c(0,0.1)) +
scale_x_continuous(limits=c(-208,808),breaks=seq(-200,800,by=100), expand = c(0.005,0), labels= c('-200','-100 ms','0','100 ms','200','300 ms','400','500 ms','600','700 ms','800')) +
ggtitle(spec_title) + theme_bw() + geom_vline(xintercept=0) +
annotate(geom='segment', y=seq(-8,8,1), yend=seq(-8,8,1), x=-4, xend=8, color='black') +
annotate(geom='segment', y=-8.2, yend=-8.38, x=seq(-200,800,100), xend=seq(-200,800,100), color='black') +
geom_segment(x = -200, y = 0, xend = 800, yend = 0, size=0.5, color='black') +
theme(legend.position = c(0.100, 0.150), legend.background = element_rect(fill='#EEEEEE', size=0),
axis.title=element_blank(), legend.key.width = unit(1.2,'cm'), legend.text=element_text(size=17),
legend.title = element_text(size=17, face='bold'), plot.title= element_text(size=20, hjust = 0.5, vjust=2),
axis.text.y = element_blank(), axis.text.x = element_text(size = 14, vjust= 2.12, face='bold', color = 'grey32', family='sans'),
axis.ticks=element_blank(), panel.border = element_blank(), panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), plot.margin = unit(c(0.1,0.1,0,0), 'cm')) +
annotate('segment', x=160, xend=216, y=-8, yend=-8, colour = 'grey75', size = 1.5) +
annotate('segment', x=270, xend=370, y=-8, yend=-8, colour = 'grey75', size = 1.5) +
annotate('segment', x=350, xend=550, y=-7.5, yend=-7.5, colour = 'grey75', size = 1.5) +
annotate('segment', x=500, xend=750, y=-8, yend=-8, colour = 'grey75', size = 1.5) +
scale_fill_manual(name = 'Context / Target trial', values=colours) +
scale_color_manual(name = 'Context / Target trial', values=colours) +
guides(linetype=guide_legend(override.aes = list(size=1.2))) +
guides(color=guide_legend(override.aes = list(size=2.5))) +
# Print y axis labels within plot area:
annotate('text', label = expression(bold('\u2013' * '3 ' * '\u03bc' * 'V')), x = -29, y = 3, size = 4.5, color = 'grey32', family='sans') +
annotate('text', label = expression(bold('+3 ' * '\u03bc' * 'V')), x = -29, y = -3, size = 4.5, color = 'grey32', family='sans') +
annotate('text', label = expression(bold('\u2013' * '6 ' * '\u03bc' * 'V')), x = -29, y = 6, size = 4.5, color = 'grey32', family='sans')
print(plot_GroupAndElectrode)
output$downloadPlot.1 &amp;lt;- downloadHandler(
filename &amp;lt;- function(file){
paste0(input$var.Group, ' group, electrode ', input$var.Electrodes.1, ', ', Sys.Date(), '.png')},
content &amp;lt;- function(file){
png(file, units='in', width=13, height=5, res=900)
print(plot_GroupAndElectrode)
dev.off()},
contentType = 'image/png')
} )
&lt;/code>&lt;/pre>
&lt;pre>&lt;code># From ui.R script
downloadButton('downloadPlot.1', 'Download HD plot')
&lt;/code>&lt;/pre>
&lt;p>&lt;strong>&lt;em>Rising to the challenge&lt;/em>&lt;/strong>&lt;/p>
&lt;p>My experience with R Shiny has been so good I've been
&lt;a href="https://pablobernabeu.github.io/2017/the-case-for-data-dashboards-first-steps-in-r-shiny/">sharing it&lt;/a>. Yet, on my first crawling days, I spent an eternity stuck with this elephant in my room: &amp;quot;μ&amp;quot;. This &lt;em>μ&lt;/em> letter (micro-souvenir from hell, as I later knew it), was part of the labels of my plots. All I knew was that I could not deploy the app online, even while I could perfectly launch it locally in my laptop. So, I wondered what use it was to deploy locally if I couldn't publish the app?! Eventually, I read about UTF-8 encoding in one forum. Bless them forums. All I had to do was use &amp;quot;Âμ&amp;quot; instead of the single &amp;quot;μ&amp;quot;. A better option I found later was: &lt;code>expression(&amp;quot;\u03bc&amp;quot;)&lt;/code>.&lt;/p>
&lt;p>Beyond encoding issues, I had a tough time embedding images. You know, the 'www' folder... To be honest, I still haven't handled the 'www' way--but where there's a will, there's a way. I managed to include my images by uploading them to a website and then entering their URL in &amp;quot;img(src&amp;quot;, avoiding the use of folder paths.&lt;/p>
&lt;pre>&lt;code>img(src=&amp;quot;https://preview.ibb.co/n7qiYR/EEG_montage.png 1&amp;quot;, height=500, width=1000)
&lt;/code>&lt;/pre>
&lt;p>Long after I had built the app, I added another image--the &lt;em>favicon&lt;/em> (the little icon on the browser tab).&lt;/p>
&lt;pre>&lt;code>tags$head(tags$link(rel=&amp;quot;shortcut icon&amp;quot;, href=&amp;quot;https://image.ibb.co/fXUwzb/favic.png&amp;quot;)), # web favicon
&lt;/code>&lt;/pre>
&lt;h3 id="reference">Reference&lt;/h3>
&lt;p>Bernabeu, P., Willems, R. M., &amp;amp; Louwerse, M. M. (2017). Modality switch effects emerge early and increase throughout conceptual processing: Evidence from ERPs [Web application]. Retrieved from &lt;a href="https://pablobernabeu.shinyapps.io/ERP-waveform-visualization_CMS-experiment">https://pablobernabeu.shinyapps.io/ERP-waveform-visualization_CMS-experiment&lt;/a>&lt;/p></description></item></channel></rss>