For loops in R: a tutorial on how to simplify your code without compromising performance (CC173)

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

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

  • @marc_CFA_applied_econ
    @marc_CFA_applied_econ 2 ปีที่แล้ว +3

    Thanks Pat. You're doing a great service for experienced and new coders alike.

    • @Riffomonas
      @Riffomonas  2 ปีที่แล้ว

      Hey Marc - my pleasure, keep watching!

  • @mukhtarabdi824
    @mukhtarabdi824 2 ปีที่แล้ว +3

    Thanks Pat, I have enjoyed with your series of using R base functions. It will be useful for us if you record another episode about nested loops in R

    • @Riffomonas
      @Riffomonas  2 ปีที่แล้ว

      My pleasure! Let me see what I can do. I have some older videos where I use map functions to replace loops. Thankfully the ability to vectorize functions like we did within this loop prevent a lot of need for nested loops

  • @hassanhijazi4757
    @hassanhijazi4757 3 หลายเดือนก่อน

    Hey Pat,
    What is the best practice when you want to populate a list but you don’t know upfront how long this might grow?
    What you do in this case?

    • @Riffomonas
      @Riffomonas  3 หลายเดือนก่อน +1

      You can certainly grow the list, which really isn't a problem if you don't think it will be long. Alternatively, I've also seen people initialize a list that's larger than you think it will be and then prune it after you know how big it actually should be

  • @krushnachChandra
    @krushnachChandra ปีที่แล้ว

    helpful video