learnTidy - 2020 Shiny Contest Submission

learnTidy

Authors: jhk0530
Working with Shiny more than 1 year

Abstract: Easily readable code is good for both code-writer and code-reader. There is tidyverse style guide to achieve this for R. with this learnTidy, code newbee including me can Interactively learn how to code with style guide of Tidyverse.

Full Description:

Short Summary

Jerry

Thanks. :yellow_heart:


Introduction

Thanks to AlphaGo and Sedol Lee, There's strongly increased demand for learn how to program in the era of big data.

And with many contribution by many awesome people, It's fine to say you can easily learn how to write R code. Because, there're many and many free resources that you can study.

In many learning curriculum both on-line and off-line, they explain technical things like How to use for.

But they don't mention coding style like You should assign with <- instead of =.

I think it's really important issue for every developer, unless he (or she) wants to work without any communication with other.

Tidyverse style guide organized and well explained about this, but I think newbee can not arrive to that document.

So I built this shiny application. with interesting topic that I didn't used before, learnr and rmarkdown.

For myself and people who want to learn (not read) well defined coding style.


Contents

learnTidy is built based on Tidyverse style guide

Here are topics I implemented in learnTidy.

  • Files
  • Syntax
  • Functions
  • Pipes
  • ggplot2

which can be restart always

and these are topics that I didn't implemented yet.

(Packages)

  • FIles
  • Documentation
  • Tests
  • Error messages
  • News
  • Git/Github

maybe me from next month will handle this problem.

or you can, come and contribute on here :heart_eyes:


Methods

to Generate interactive tutorial

I use learnr and also rmarkdown.

to build Exercise or Quiz

since style guide needs example with long codes
it was complex to build proper problems.

so I choosed to assign code as correct or wrong in fixing problem. to see their result with run code

and for code multiple line needed that hard to fix, I built selection problems.

to design UI

Again, It was hard challenge to me to customize my tutorial.
because learnr's manuscript wasn't helpful for me.

This is all it explained, even any examples.

  • So I collected tutorial format.
  • and built - customized for myself
  • That includes modify htm and pandoc, css file
  • and export customized rmarkdown output format with customized package.
  • Actually, I used emoji with emo package, but it suddenly not worked.

to deploy on shinyapps.

This was 2nd hard challenge for me, to achieve this I surfed tons of issue, Q&A, documents.
because, learnTidy uses custom rmarkdown format as rendering output, which is built on custom package learnTidy.

but to use learnTidy, that custom package needs to be installed. How awful dillema. It worked very well on my local machine.

And to deploy learnTidy on shinyapps.io I used almost entire last weekend to handle package dependency problem.

Anyway, packrat wasn't helpful.


Note

  • Example quiz, and exercise is poor I think.
  • :sweat: learnTidy doesn't work properly on RStudio Cloud project. I'm not sure, but I think it's related with package dependency maybe.

Category: Education
Keywords: learnr, rmarkdown, tidyverse, style-guide, styler
Shiny app: https://jhkim.shinyapps.io/learnTidy/
Repo: https://github.com/jhk0530/learnTidy
RStudio Cloud: Posit Cloud

Thumbnail:

Full image:

1 Like