Use GLUE in RMD to generate dynamic description about your data in R Markdown! 🚀 📊✨

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น • 2

  • @CanDoSo_org
    @CanDoSo_org 10 หลายเดือนก่อน +1

    Hi, thanks. But why don't you use:
    cat(glue("There are **{nrow(diamonds)}** diamonds in the dataset."))
    instead of:
    glue("There are **{nrow(diamonds)}** diamonds in the dataset.")
    Same output but the later one is simpler.

    • @DataAnalytic
      @DataAnalytic  10 หลายเดือนก่อน +2

      Correct, by default if you give the name of a variable, it gets printed
      so all three will give you same results.
      cat (glue('There were {nrow(diamonds)} diamonds in the dataset. '))
      glue('There were {nrow(diamonds)} diamonds in the dataset. ')
      print(glue('There were {nrow(diamonds)} diamonds in the dataset. '))