- Видео 61
- Просмотров 79 693
Bruno Rodrigues
Люксембург
Добавлен 3 июл 2007
I make videos about R and rant about free software.
Read my blog: www.brodrigues.co where I also discuss bout R and rant about free software.
Read my blog: www.brodrigues.co where I also discuss bout R and rant about free software.
Quick intro to {rix}
{rix} is an R package that leverages Nix, a package manager focused on reproducible builds. With Nix, you can create project-specific environments with a custom version of R, its packages, and all system dependencies (e.g., GDAL). Nix ensures full reproducibility, which is crucial for research and development projects.
Use cases include running web apps (e.g., Shiny, {plumber} APIs) or {targets} pipelines with a controlled R environment. Unlike {renv}, which snapshots package versions, {rix} provides an entire ecosystem snapshot, including system-level dependencies.
While Nix has a steep learning curve, {rix}
- simplifies creating Nix expressions, which define reproducible environments.
- let...
Use cases include running web apps (e.g., Shiny, {plumber} APIs) or {targets} pipelines with a controlled R environment. Unlike {renv}, which snapshots package versions, {rix} provides an entire ecosystem snapshot, including system-level dependencies.
While Nix has a steep learning curve, {rix}
- simplifies creating Nix expressions, which define reproducible environments.
- let...
Просмотров: 654
Видео
Why use Github Actions (as an R programmer) ?
Просмотров 1,1 тыс.4 месяца назад
In his video I give a quick intro to Github Actions as an R user. Read my blog posts on Nix: www.brodrigues.co/tags/nix Read my books to learn about R and building reproducible analytical pipelines: www.brodrigues.co/about/books/ Follow me on twitter: brodriguesco Follow me on Mastodon: fosstodon.org/@brodriguesco Read my blog: www.brodrigues.co
rix: An R package for reproducible dev environments with Nix (FOSDEM 2024)
Просмотров 4039 месяцев назад
This is a short talk I gave on 4th of February at FOSDEM 2024, in Brussels. I present my R package called {rix}, which makes it easy for R programmers to use Nix to create project-specific development environments, complete with a dedicated version of R and R packages. Essentially, using rix and Nix, it is possible to replace renv Docker. If you want to know more, visit rix’s website: b-rodrigu...
Warnings as errors for robust pipelines with {chronicler}
Просмотров 520Год назад
In this video I'll show you how you can use my package {chronicler} which helps you deal with stupid mistakes like filters that result in empty data sets, or typos that result in errors that can be hard to find. {chronicler} essentially adds a log to every object you compute, which you can read later on to find out what's wrong with it! By combining {chronicler} and Nix you can really create ve...
Reproducible R development on Github Actions with Nix
Просмотров 599Год назад
In this video I'll show you how you can use Nix to create a reproducible development environment that can then be used on Github Actions to build anything! The example I'm discussed shows how you can use Github Actions to render a Quarto document reproducibly. My previous videos on Nix which you should watch to follow along: ruclips.net/video/c1LhgeTTxaI/видео.html ruclips.net/video/R3t83-2aNwY...
Nix for R users with {rix} - running an old project with an old R and old packages
Просмотров 446Год назад
In this video I show you how you can run an old {targets} project by installing an old version of R and R packages using the Nix package manager. To make it easier for R users to use Nix, I developed the {rix} package which makes it easy to specify the R version that you need and R packages and then install them using Nix. There are some cuts in the video that I needed to do, so if you see the ...
Reproducible R development environments with Nix
Просмотров 1,2 тыс.Год назад
In this video I introduce Nix, a package manager for Linux, macOS and Windows, which allows one to build reproducible development environment. Using Nix, it is essentially possible to replace {renv} and Docker simultaneously. I show how Nix can be used to build reproducible development environments for R, and also introduce my package, {rix}, which assists in doing so. Follow me on twitter: twi...
Building reproducible analytical pipelines with R at ReproTea (2023-07-19)
Просмотров 1 тыс.Год назад
This is a recording of a Zoom talk I gave on July 19th, 2023 for ReproducibiliTea UCL. Learn more on their website: sites.google.com/view/reproducibilitea-ucl/home I talk about how {renv}, {targets} and Docker can be used to build reproducible analytical pipelines. The slides are available here: is.gd/raps_reprotea You can get a Docker image with RStudio and all the code and slides here: hub.do...
How this one habit made me a (better) programmer (as a non programmer)
Просмотров 886Год назад
Always solve the more general problem, instead of the particular problem you're facing. Read my blog: www.brodrigues.co Buy me a coffee, my kids don't let me sleep: www.buymeacoffee.com/brodriguesco Learn R by reading my free ebook: b-rodrigues.github.io/modern_R/
Three tricks to make IDEs other than Rstudio better for R development
Просмотров 3,4 тыс.2 года назад
In this video I show you three tricks to make IDEs othen than Rstudio better for R development: - A plot pane (using {httpgd}) - A "view data" pane (using {reactable}) - A "view in Excel" function Gist with code over here: gist.github.com/b-rodrigues/948156d09607e5e8e66b80e5b318a854 Documentation of {httpgd}: cran.r-project.org/web/packages/httpgd/readme/README.html Documentation of {reactable}...
Monads implement flatmap? Waaat?
Просмотров 2702 года назад
You might read online that monads are things with a flatmap() function. But what is meant by this? What is flatmap()? Link to slides: ornate-crumble-174af3.netlify.app/#/ You should watch my previous video to follow this one, especially if you don't know what monads are at all: ruclips.net/video/Hlypj6-n51c/видео.html Link to the blogpost I wrote about monads: www.brodrigues.co/blog/2022-04-11-...
Why you should(n't) care about Monads if you're an R programmer
Просмотров 2 тыс.2 года назад
Want to have some intuition on monads? Why are they used for? Should you use monads? Answers to these questions and more in this video! Link to the slides: is.gd/5Hq98S Link to the blogpost I wrote about monads (all references and code is in there): www.brodrigues.co/blog/2022-04-11-monads/ Link to function factories: adv-r.hadley.nz/function-factories.html Follow me on twitter: bro...
[VLOG] My linux distribution of choice, and overall setup
Просмотров 5002 года назад
A video where I discuss my setup. Some people ask what I use, so here it is. My video on spacemacs: ruclips.net/video/lerL043DWRg/видео.html My blog post on spacemacs: www.brodrigues.co/blog/2019-05-19-spacemacs/ My video on keyboards: ruclips.net/video/LMkFdqEpISo/видео.html Shoutout to Miha: mihagazvoda Read my blog: www.brodrigues.co Buy me a coffee, my kids don't let me sleep: w...
Extreme Rmarkdown report automation with parameters and templates
Просмотров 4,1 тыс.2 года назад
A continuation of a previous video (ruclips.net/video/R7WiF2Vcb2o/видео.html) in which I discuss how to run parametrized Rmarkdown document. This will allow you to write a single .Rmd file and then generate potentially 100's of output documents by looping over a list of countries, cities, companies etc... so in the end you will have the same report, one for each country/city/company! The other ...
Little-known useful R functions #6: add logs to your functions using {loud}
Просмотров 6582 года назад
Little-known useful R functions #6: add logs to your functions using {loud}
Watch me add a feature to a function in my {loud} package
Просмотров 2862 года назад
Watch me add a feature to a function in my {loud} package
Generating Rmarkdown source with knit_expand (+ learn about iwalk/imap!)
Просмотров 9972 года назад
Generating Rmarkdown source with knit_expand ( learn about iwalk/imap!)
Generating Excel files from R - avoids having to use Excel!
Просмотров 9212 года назад
Generating Excel files from R - avoids having to use Excel!
Esoteric functional programming knowledge for big brained individuals
Просмотров 5773 года назад
Esoteric functional programming knowledge for big brained individuals
Little-known useful R functions #5: a nice print method for data objects with {paint}
Просмотров 1,1 тыс.3 года назад
Little-known useful R functions #5: a nice print method for data objects with {paint}
Genetic algorithms, the tidy way (and software development) - Part 3
Просмотров 2143 года назад
Genetic algorithms, the tidy way (and software development) - Part 3
Genetic algorithms, the tidy way (and software development) - Part 2
Просмотров 2173 года назад
Genetic algorithms, the tidy way (and software development) - Part 2
Genetic algorithms, the tidy way (and software development) - Part 1
Просмотров 5703 года назад
Genetic algorithms, the tidy way (and software development) - Part 1
Little-known useful R functions #4: add logs to {tidyverse} functions with {tidylog}
Просмотров 6073 года назад
Little-known useful R functions #4: add logs to {tidyverse} functions with {tidylog}
Scraping the data from graphs with {metaDigitise}
Просмотров 1,8 тыс.3 года назад
Scraping the data from graphs with {metaDigitise}
Little-known useful R functions #3: plotting in the terminal with {devoutansi}
Просмотров 4523 года назад
Little-known useful R functions #3: plotting in the terminal with {devoutansi}
Watch me compile R 4.1.0 from source on GNU/Linux
Просмотров 7083 года назад
Watch me compile R 4.1.0 from source on GNU/Linux
How to handle large files with R using {readr} 2.0
Просмотров 2,7 тыс.3 года назад
How to handle large files with R using {readr} 2.0
New series "Little-known useful R functions #2: boom() from {boomer}"
Просмотров 5963 года назад
New series "Little-known useful R functions #2: boom() from {boomer}"
Where do these actions run? Is the OS you specify on your laptop/desktop? Do the automated installs happen there or on a remote machine? Some basic info I guess can research and would have been useful presented here.
great intro!
Awesome Tool!
boom !
almost reminds me of check_g() from your package (i believe lol) but returning each individual call as opposed to a centralized framework but similar philosophy- check_g()/chronicler is insane btw hehe great job on it !!
Timing is perfect! I was just about to start learning Github Actions.
what about if I have to use files, like compare my code to a reference file?also does it work if it is not a package? Many thanks!
The workflow can checkout your repository and thus have access to all the files contained in it, you could also download files using wget if you need to. And yes Github Actions can handle any type of use case, you don't need to be in a package
Does it mean that every timei update and push docu or readme it will take ages? I don't like this too much..
The push is just as fast as before, actions run once the push is done.
White emacs theme disgusting 🤢
I already told him! Lol
Thank you once more for creating awesome content 😊
so helpful!! I just spent hours on ChatGPT trying to figure this out and your video helped me get it done in a few minutes
Question: Will your book on reproducibility be updated with nix? I found it super useful for ky work and would love more information on the nix package. Thank you!
Yes that’s the plan! It might be a separate, new book though.
@@brodriguesco Awesome! Looking forward to it
Wait, don't people use renv for virtual environments in R?
renv only deals with R packages, but by using Nix, we get an environment with a chosen version of R, all the packages’ dependencies and their dependencies and so on (including system-level dependencies, not just R packages).
Luckily your wife, I hope, is not an avid consumer of your great videos :)
httpgd dev here. Thanks for the shout-out!
Amazing!
Hey Dr., I have a quick question as I revisited your excellent video. On minute 8:00 where you are running the map, I was aware that the xlsx_cells() function would need the path or the name of the file into double commas but in your 'paths' column they are not so how is map capable of running it? thanks!
Amazing package, really needed!
Great content, please keep on doing this!
In your opinion what is the benefit of using nix instead of doing the same with conda? Also how does nix manage a situation where the r package is available (say on GitHub) but is not yet in the nix repo?
The advantage of Nix is the fact that it is completely reproducible, down to the system level (so dependencies like compilers for example also get installed), and handles more software than conda. You can also define expressions that do more than install packages, but also build whole projects. Nix handles packages from Github as well, here's some documentation b-rodrigues.github.io/rix/articles/building-reproducible-development-environments-with-rix.html#installing-packages-from-github
@@brodriguesco I see, thank you for clarifying! So if I need to add a new package on the fly (during the analysis) I would need to generate a new .nix file correct!? In that sense how would you organize the workflow? do I treat them as conda envs, or would you generate one .nix per project/single analysis?
I haven't had the chance to use Nix to manage python projects yet, but I would likely do what I do for R projects, namely project-specific Nix expressions that build the environment I need, so yeah one per project.
Great package !
This is great stuff dude. Feels like it needs 10x the views. Fantastic!!!
but wouldn't it be simplest to just write some tests about how the data should look? Not clear why we need a whole package/framework to solve this problem.
I use both, tests and this. The thing is that you can’t always think about every potential problem to add to your tests before-hand, so having pipelines fail early is still quite useful.
Thank you!
Thank you! Would be nice, to compare it with python monadic operations.
All the best Bruno, you are a source of inspiration.
That sounds pretty awesome! Did I catch you right, that if I want to make my project reproducible, all I have to do is to create a default.nix file (e.g., by using your rix package) and share this together with my project? Others can then use nix to reproduce the environment + package versions based on the default.nix file across all plattforms?
Exactly! Try it with this repository github.com/b-rodrigues/chronicler_targets_pipeline clone it, run 'nix-build' inside a terminal; this will install a separate environment with R, R packages and everything else needed. Then type 'nix-shell' (of course Nix needs to be installed) in a terminal in the same directory. You'll be inside an R session as defined by that default.nix. You can then type 'targets::tar_make()' to actually run the pipeline and see the output appear in your directory (analysis.html).
Very helpful! Thank you for making these videos!
Thank you for your hard work. Looking forward to the new book.
Thank you Bruno for this Knit_expand looks powerful I had to do something similar but didnt know about this function so i did it in a loop Keep up the good work and sharing such powerful tips
haha sniffing at the middle of the video like a real programmer
Interesting that you use Emacs and ESS. Great choice! Nice video.
Love it
Thanks, Bruno. It's really useful to come back to this after letting the functional programming ideas percolate through my brain.
Glad it was helpful!
Thank you for this Bruno. As a follow up, - what is the best way to read xlsb files; haven't found a way yet found onepackage readxlsb but it took too long to read and didn't use it - what if you want to grap the name of the dataset from the list_data variable, how you would approach that
There's this package that supposedly reads xlsb files: cran.r-project.org/web/packages/readxlsb/vignettes/read-xlsb-workbook.html but I haven't tried it! As for the second question, could you elaborate, I'm not sure I understand?
@@brodriguesco thanj you bruno Used this package and got issues with it I was thinking if u did the below List(iris,mpg) I want to get a vector as “iris”, “mpg” As you have once said challenge is that when such object are too many so there should be an automated way to do it
Super helpful content!!!!!!!! Thanks for sharing.
Pinning a version or specifying a version is allowed with other package managers. He's not telling us the real benefit of nix. I'm waiting for him to get to it, but he just talks about things all package managers do. He needs to get to home manager, the declarative aspect, and especially flakes, then he'll be onto something that only nix provides.
Specifying a version is allowed, but definitely not something that works smoothly with other package managers. Try to install R version 3.5.0 on current ubuntu using apt-get, see how it goes. And then try to install R version 4.1.0 for another project at the same time, have fun! Home manager: totally irrelevant here. Declarative aspect: see 8:58 Flakes: not (yet) an official feature of Nix, so I prefer having to avoid them for now. As long as I can manage without them, I'd prefer not to impose them on my users.
Baby steps
Dealing with all the libraries is called dependency management, and all package managers can handle dependencies. Yes, nix is second largest package manager, second only to Arch user repository.
The point is that you can install an R library, like dplyr, using Nix as well, and not have to use R's internal package manager. Using Nix, every system-level dependency will get installed as well, which is not the case using R's internal package manager. See 5:04. Do you comment before you're done watching the whole video?
winget is another package manager. There is no "THE" package manager. There are a few.
I said "THE package manager for Windows, apparently", it's a reference to what they're saying themselves, see the picture at 2:00.
1:50 Actually winget is now the "official" windows package manager. It's made by Microsoft but is open source. I've transitioned all my chocolately packages over to it now (except one niche one and for really old versions of packages I need). It seems pretty well supported for the future at this point.
Thanks for the explanation!
Looks amazing, can't wait to try!
Really appreciate all your videos and this one is no exception, thanks!
{rix}, it looks pretty neat and easy to use. I'm really starting to care about reproducibility, so I'm definitely going to check it. Thanks!
New Bruno video. NICE!
sorry for the wait
I was here!
Your book is gold. Thank you !
I have a question for you; maybe you are the most relevant person to start this conversation with: why do courses/tutorials on R loops focus on base for loop while for the long-run progress one ought to use foreach anytime s\he can? I am prising foreach because of efficiency concerns + parallelization possibilities
Really depends what you want to teach. If you’re simply focusing on teaching the concept of repeating a computation, then simply using the base for/while loop is enough. But I agree that teachers/trainers should, at the end of such a chapter focusing on loops, at least mention the possibility to run loops in parallel.
good channel
wow
Thanks for the tip, Bruno. Personally, I didn't like as much as I thought I would when trying this one for myself, maybe because of the (too) colorful palette. I'll try again with some other palette to see if it suits me better.
Bruno, this is exactly the technique I was looking for to automate this type of process/exercise at my job! Thanks for that, man!
You remind me of my cousin.