Tuesday, August 19, 2014

dplyr: A gamechanger for data manipulation in R

I demonstrate how to use dplyr for data manipulation in R (R code and data on GitHub ). I had heard of the package before and finally gave it a try after attending Hadley Wickham's presentation at useR! in LA a couple of months ago. dplyr will change your life as it relates to data manipulation!

28 comments:

  1. Nice job! I didn't catch if you used the minus sign on a numeric variable or not, but it might only work on numeric. The desc() function would arrange the variable in descending order regardless of variable type (ascending is the default).

    Your microphone is picking up thumping sounds from your typing. A cheap solution to that is to place a thin layer of packing foam underneath your keyboard. If your microphone is on a stand, you can put it under that too.

    Keep up the good work!

    ReplyDelete
  2. Great video! I have been using sqldf to do this type of data manipulation but maybe I should switch to dplyr.

    ReplyDelete
    Replies
    1. Thanks, Paul! Yeah, this is way better than sqldf. How could I forget to mention the joins? Check out ?left_join and you'll never need to use merge() or the sqldf package again.

      Delete
  3. Great overview of a fantastic package. Love dplyr. And your succinct and super-short explanation belies just what a game changer this is. thanks. well done.

    ReplyDelete
  4. That was great. Appreciate the effort, nice and concise.

    ReplyDelete
  5. Thanks, very nice video.

    I didn't see how, in your example, using dplyr helped with ggplot. However, you could have used the "pipe" operator %>% instead of + (but I'm not sure why it would be "better").

    ReplyDelete
    Replies
    1. I was trying to make the ggplot work without dplyr, but I wasn't able to do so. One of the main reasons I prefer dplyr is to have the flexibility of storing the summary data in a data frame - after the object has been created, you could make a table, a bar graph, or a line graph to present the data minimal extra work.

      Delete
  6. Yeah, dplyr has been super hot in the R blogosphere lately! I haven't watched that yet but I'll check it out - looks very in depth.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Great blog and article! If you want to know more or learn about data integration techniques and methods please contact us from the links below

    The article is meant to help informatica interview questions and answers for experienced
    individuals or students preparing on this particular topic. There are so many new important informatica
    scenario based questions
    points, question covered and different new points all covered in
    this piece all at ease. The best informatica interview questions thing about the article is
    that it makes studying and preparation quite simple for individuals and accordingly they can
    prepare for the informatica questions
    interview.

    ReplyDelete
  9. Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck for the upcoming articles .

    Digital Marketing Training in Chennai

    Digital Marketing Course in Chennai

    ReplyDelete
  10. تعتبر مصانع عبوات بلاستيك العصائر جزءًا أساسيًا من صناعة المشروبات الغازية والعصائر المعبأة. تهدف هذه المصانع إلى إنتاج وتصنيع عبوات بلاستيكية عالية الجودة وآمنة لتعبئة المشروبات السائلة مثل العصائر والمشروبات الغازية.

    ReplyDelete
  11. مصانع إنتاج أفلام استرتش تغليف تلعب دورًا حاسمًا في صناعة التغليف، حيث تقوم بتصنيع أفلام الاسترتش التي تستخدم في تغليف المنتجات. إليك بعض الوظائف الرئيسية لهذه المصانع:

    إنتاج أفلام التمدد: تقوم المصانع بإنتاج أفلام الاسترتش باستخدام مواد بلاستيكية مثل البولي إيثيلين عالي الكثافة (HDPE) أو منخفض الكثافة (LDPE). هذه الأفلام يتم تصنيعها بتقنيات خاصة لتحقيق الخصائص المطلوبة من المرونة والقوة والتمدد.

    تطوير وتحسين التقنيات: تعمل المصانع على تطوير وتحسين تقنيات إنتاج شرنك حرارى بولي اولفين لتلبية احتياجات السوق وتحسين أداء التغليف. يتم ذلك من خلال الاستثمار في البحث والتطوير وتبني تقنيات إنتاج متقدمة.

    ReplyDelete
  12. تهتم شركة السلطان افضل شركة نقل عفش بالقاهرة بعملية تغليف الاثاث لانها تساعد علي :
    سهولة التحميل والتفريغ: عندما يتم تغليف الأثاث بشكل صحيح، يسهل رفعه وتحميله داخل وخارج وسيلة النقل. يمكن أن يساعد التغليف في تقليل الوزن الظاهري للأثاث وجعل عملية التحميل والتفريغ أكثر فعالية.

    الحفاظ على النظافة: يحمي التغليف الأثاث من الأتربة والأوساخ التي يمكن أن تلتصق به خلال عملية النقل. هذا يحافظ على نظافة الأثاث ويقلل من الحاجة إلى التنظيف العميق بعد الوصول إلى الوجهة الجديدة.

    ReplyDelete