courtiol / LM2GLMM

This is the repository for the R package I use for teaching linear models.
4 stars 2 forks source link

clarify what are demos from what are practical advices #5

Closed courtiol closed 2 years ago

courtiol commented 6 years ago

To make it clearer for the students to understand what is there "just" to show them how things work from what they need to do in practice, I could perhaps split slides like that and use some graphical way to make it clear (different background? Different color for the titles?).

courtiol commented 2 years ago

I use emojis at the top of each slide to indicate what it refers to:

I may also use a few others within the slides

LiamDBailey commented 2 years ago

FYI; Hadley's {{emo}} package (r devtools::install_github("hadley/emo")) has a wider variety of emojis than {{emojifont}}. As far as I can tell, every emoji in {{emojifont}} is in {{emo}} but not visa-versa

Will we need ๐Ÿ˜  r emojifont::emoji("angry") for the students or this is just for us?

courtiol commented 2 years ago

I would rather not to use {emo} because it is not on CRAN and because the exact display of many emojis from this package is random (they have multiple instances and are drawn randomly).

I like the nerd face and would have like to use it but I don't think it is part of {emojifont} (that's too bad). Yet, it seems I can just paste those emojis without using R call: image

I worry that in such a case, the output depends on the fonts installed on your system. Do you know?

I consider everything good to know as required to pass the test but the most important things are labelled with :dart:

So all in all I think that the only emoji I use that is not quite obvious enough is the :eyeglasses:. Can you think of a better alternative in {emojifont} or shall I just paste ๐Ÿงช ?

LiamDBailey commented 2 years ago

From my (limited) understanding of emojis, because they are coded in Unicode then copy-pasting them should be no problem because all systems understand Unicode. However, the output will vary slightly by system (i.e. it's different between MacOS and Windows) because each system translates the underlying Unicode differently, but they should still be generally understandable by the students no matter the system. But anyway, for reproducibility I can see that using {{emojifont}} is preferable because it's on CRAN. In that case I would suggest some alternatives for the glasses:

LiamDBailey commented 2 years ago

I have no idea why they have an emoji for an alembic but not a test tube ๐Ÿคท

LiamDBailey commented 2 years ago

Alternatively, seems you can also print the unicode directly as ASCII characters and it will then be converted to an emoji when knitting (that's what I understand is happening anyway).

r knitr::asis_output("\U1F97D") = ๐Ÿฅฝ r knitr::asis_output("\U1F9EA") = ๐Ÿงช

I find all the emojis (and their underlying Unicode values) here: https://emojipedia.org/

courtiol commented 2 years ago

OK great! Will use the test tube then! I will wrap everything in a function so that I can change symbols in one place and propagate the change all over.

courtiol commented 2 years ago
.emo <- function(x = c("info", "practice", "proof", "goal", "party", "broken", "heavy", "warn", "alien")) {
  x <- match.arg(x)
  if(!requireNamespace("emojifont")) stop("You need to install the package emojifont to use this function.")
  switch (x,
    info = emojifont::emoji("mortar_board"),
    practice = emojifont::emoji("wrench"),
    proof = knitr::asis_output("\U1F9EA"),
    goal = emojifont::emoji("dart"),
    party = emojifont::emoji("tada"),
    broken = emojifont::emoji("angry"),
    heavy = emojifont::emoji("fire"),
    warn = emojifont::emoji("warning"),
    alien = emojifont::emoji("alien")
  )
}

> sapply(c("info", "practice", "proof", "goal", "party", "broken", "heavy", "warn", "alien"), .emo)
    info practice    proof     goal    party   broken    heavy     warn    alien 
    "๐ŸŽ“"     "๐Ÿ”ง"     "๐Ÿงช"     "๐ŸŽฏ"     "๐ŸŽ‰"     "๐Ÿ˜ "     "๐Ÿ”ฅ"      "โš ๏ธ"     "๐Ÿ‘ฝ" 
LiamDBailey commented 2 years ago

looks great

courtiol commented 2 years ago

OK, I will do that everywhere as I go! Thanks again.