Efficient R
HTML-код
- Опубликовано: 17 окт 2024
- For most data analysis and statistical computing, R is efficient enough. However, there are times when we encounter bottlenecks in our code that slow it down significantly. In this lecture, I’ll teach you techniques to identify those bottlenecks and write more efficient code. You’ll learn the fundamental principles of faster R code and discover efficient packages for data analysis. We’ll also touch on advanced optimization methods like parallelization and integrating C++ code. If you have previous experience with R programming and looking to make your R code run faster, this lecture is for you. If you are an R beginner, you’ll still benefit from learning the principles and patterns but the more advanced techniques won’t be relevant for you yet.
📕 Efficient R Programming Book by Gillespie and Lovelace (O'Reilly): bookdown.org/c...
🗨️ My lecture on good practice R coding: coming soon (sorry, still need to record it :))
I didn't know about the collapse package, this is an amazing discovery ! Thank you for this content
Thank you so much for such an informative video.
THANK YOU - one of the best videos I have had on R in some time
Thanks for such an amazing RUclips video. I am a PhD student and this will help me optimize my codes and safe some parts of my memory for other uses. Big love
Thank you for your nice feedback 😊
Special thanks from a brazilian economist! Learned a lot.
Great Presentation, Selina. 👍
Great video. I didn't know a lot of the packages, thanks for the clear explanations.
Amazing video! I work as an econometrician and your presentation gives me a lot of ideas 😊
Could you share your presentation as a pdf file?
Thanks for your nice feedback, good to hear that you got ideas from it!
A bit clunky, but you can download the presentation pdf from the depths of my Github project:
github.com/selinaZitrone/tools_and_tips/blob/main/docs/slides/2023_11_16_efficient_r.pdf
Thanks a lot, great peace of knowledge
Very informative on how to optimize R code
Amazing video. Thanks you, I will start learning from u.
Great and useful video, thank you so much!
Thanks from the Netherlands :)
Thanks Selina.
this realy helps me with my studies! Thank you Selina
Thanks from Ghana.
Great video 👏🏻👏🏻👏🏻👏🏻
If possible, could you share the link that you mention in the video concerning a course on parallelisation?
Sure. You might consider starting with these two ressources:
- Tutorial on the futureverse: henrikbengtsson.github.io/future-tutorial-user2022/index.html
- Documentation website of the futureverse with link to further tutorials etc: www.futureverse.org/
Happy Coding :)
@@selinabaldauf7529 thank you so much
This was great! Thanks Selina!!
Very nice!
I loved this content
Hi i create parameterized report for about 30 staff using for loop i think using apply function would be faster thanks for the video 👍. Are you on linked in :)
Hope you managed to make your loop faster. If in doubt, use profiling to see where your bottleneck is. Oh, and I am not on LinkedIn :)
By far, my efficiency hurdles with R are in terms of memory usage. I don't really understand why R needs to load all the dataset into memory before working with it. I am sure the clever guys at Posit could address this issue if they chose to.
Thanks, when using collapse, "filter" is still "filter", not "ffilter", right?
You are welcome :)
Actually, the collapse package does not have a function called "filter".
To have a fast filter for rows in a table, you can use the function "fsubset". It works similar to the "subset" function in base R, just faster. On the package homepage, you can also find a nice cheat sheet with a list of all collapse functions for different purposes: sebkrantz.github.io/collapse/
Thanks.@@selinabaldauf7529
You have new sub
👍
Efficient R is an oxymoron surely
@@generalyoutubewatching5286 Yes this argument can be made for sure 😃. Maybe it's more about "efficient enough R" or "more efficient R". But for sure R should not be used if efficiency is the main requirement for a project 😉 But at least in my field (biological science) it's efficient enough for most tasks
That means do not write in R.
Well, I guess it depends on what you want to do 😊 but if speed is the priority, R might not be the right choice
*sf::st_intersection(),* the epitome of least efficient code in the universe!
Do you by any chance know a more efficient function that does the same thing?
@baldauf7529not in R. But performing the same operation in GUI-based packages like QGIS is lightning fast compared to this function. I haven't managed to know why this is so slow at this level.