Dirk Eddelbuettel: #41: Using r2u in Codespaces
Welcome to the 41th post in the $R^4 series. This
post draws on joint experiments first started by Grant building on the
lovely work done by Eitsupi as
part of our Rocker Project. In
short, r2u is an ideal
match for Codespaces, a
Microsoft/GitHub service to run code locally but in the cloud via
browser or Visual Studio
Code. This posts co-serves as the README.md in the .devcontainer
directory as well as a vignette
for r2u.
So let us get into it. Starting from the r2u repository, the .devcontainer
directory provides a small self-containted file
devcontainer.json to launch an executable environment R
using r2u. It is based on the example in Grant
McDermott s codespaces-r2u repo and reuses its documentation. It is
driven by the Rocker
Project s Devcontainer Features repo creating a fully functioning R
environment for cloud use in a few minutes. And thanks to r2u you can add easily to
this environment by installing new R packages in a fast and failsafe
way.
Try it out
To get started, simply click on the green Code button at the top
right. Then select the Codespaces tab and click the + symbol to
start a new Codespace.
The first time you do this, it will open up a new browser tab where
your Codespace is being instantiated. This first-time instantiation
will take a few minutes (feel free to click View logs to see how
things are progressing) so please be patient. Once built, your Codespace
will deploy almost immediately when you use it again in the future.
After the VS Code editor opens up in your browser, feel free to open
up the examples/sfExample.R
file. It demonstrates how r2u enables us install
packages and their system-dependencies with ease, here
installing packages sf (including all its
geospatial dependencies) and ggplot2 (including
all its dependencies). You can run the code easily in the browser
environment: Highlight or hover over line(s) and execute them by hitting
Cmd+Return (Mac) /
Ctrl+Return (Linux / Windows).
(Both example screenshots reflect the initial codespaces-r2u
repo as well as personal scratchspace one which we started with, both of
course work here too.)
Do not forget to close your Codespace once you have finished using
it. Click the Codespaces tab at the very bottom left of your code
editor / browser and select Close Current Codespace in the resulting
pop-up box. You can restart it at any time, for example by going to
https://github.com/codespaces and clicking on your instance.
Extend r2u with r-universe
r2u offers
fast, easy, reliable access to all of CRAN via binaries for
Ubuntu focal and jammy. When using the latter (as is the default), it
can be combined with r-universe
and its Ubuntu jammy binaries. We demontrates this in a second example
file examples/censusExample.R
which install both the cellxgene-census
and tiledbsoma R
packages as binaries from r-universe (along with about 100
dependencies), downloads single-cell data from Census and uses Seurat to create PCA and
UMAP decomposition plots. Note that in order run this you have to
change the Codespaces default instance from small (4gb ram) to large
(16gb ram).
Local DevContainer build
Codespaces are DevContainers running in the cloud (where
DevContainers are themselves just Docker images running with some VS
Code sugar on top). This gives you the very powerful ability to edit
locally but run remotely in the hosted codespace. To test this setup
locally, simply clone the repo and open it up in VS Code. You will need
to have Docker installed and running on your system (see here). You will also
need the Remote
Development extension (you will probably be prompted to install it
automatically if you do not have it yet). Select Reopen in Container
when prompted. Otherwise, click the >< tab at the
very bottom left of your VS Code editor and select this option. To shut
down the container, simply click the same button and choose Reopen
Folder Locally . You can always search for these commands via the
command palette too (Cmd+Shift+p /
Ctrl+Shift+p).
Use in Your Repo
To add this ability of launching Codespaces in the browser (or
editor) to a repo of yours, create a directory
.devcontainers in your selected repo, and add the file .devcontainers/devcontainer.json.
You can customize it by enabling other feature, or use the
postCreateCommand field to install packages (while taking
full advantage of r2u).
Acknowledgments
There are a few key plumbing pieces that make everything work here.
Thanks to:
- My Rocker Project
colleague @eitsupi
for maintaining the R
DevContainer Features.
- @renkun-ken and the rest of the VS Code R
extension team.
- @Enchufa2 for
bspm making
package installation to the sysstem so seamless.
- @grantmcdermott for the initial
codespaces-r2u
setup from which we derived this.
- Last but not least everybody who helped me make r2u possible, tested it,
or sent hints for improvement.
Colophon
More information about r2u is at its site, and we
answered some question in issues, and at stackoverflow. More questions
are always welcome!
If you like this or other open-source work I do, you can now sponsor me at
GitHub.
examples/censusExample.R
which install both the cellxgene-census
and tiledbsoma R
packages as binaries from r-universe (along with about 100
dependencies), downloads single-cell data from Census and uses Seurat to create PCA and
UMAP decomposition plots. Note that in order run this you have to
change the Codespaces default instance from small (4gb ram) to large
(16gb ram).
Local DevContainer build
Codespaces are DevContainers running in the cloud (where
DevContainers are themselves just Docker images running with some VS
Code sugar on top). This gives you the very powerful ability to edit
locally but run remotely in the hosted codespace. To test this setup
locally, simply clone the repo and open it up in VS Code. You will need
to have Docker installed and running on your system (see here). You will also
need the Remote
Development extension (you will probably be prompted to install it
automatically if you do not have it yet). Select Reopen in Container
when prompted. Otherwise, click the >< tab at the
very bottom left of your VS Code editor and select this option. To shut
down the container, simply click the same button and choose Reopen
Folder Locally . You can always search for these commands via the
command palette too (Cmd+Shift+p /
Ctrl+Shift+p).
Use in Your Repo
To add this ability of launching Codespaces in the browser (or
editor) to a repo of yours, create a directory
.devcontainers in your selected repo, and add the file .devcontainers/devcontainer.json.
You can customize it by enabling other feature, or use the
postCreateCommand field to install packages (while taking
full advantage of r2u).
Acknowledgments
There are a few key plumbing pieces that make everything work here.
Thanks to:
- My Rocker Project
colleague @eitsupi
for maintaining the R
DevContainer Features.
- @renkun-ken and the rest of the VS Code R
extension team.
- @Enchufa2 for
bspm making
package installation to the sysstem so seamless.
- @grantmcdermott for the initial
codespaces-r2u
setup from which we derived this.
- Last but not least everybody who helped me make r2u possible, tested it,
or sent hints for improvement.
Colophon
More information about r2u is at its site, and we
answered some question in issues, and at stackoverflow. More questions
are always welcome!
If you like this or other open-source work I do, you can now sponsor me at
GitHub.
.devcontainers in your selected repo, and add the file .devcontainers/devcontainer.json.
You can customize it by enabling other feature, or use the
postCreateCommand field to install packages (while taking
full advantage of r2u).
Acknowledgments
There are a few key plumbing pieces that make everything work here.
Thanks to:
- My Rocker Project
colleague @eitsupi
for maintaining the R
DevContainer Features.
- @renkun-ken and the rest of the VS Code R
extension team.
- @Enchufa2 for
bspm making
package installation to the sysstem so seamless.
- @grantmcdermott for the initial
codespaces-r2u
setup from which we derived this.
- Last but not least everybody who helped me make r2u possible, tested it,
or sent hints for improvement.
Colophon
More information about r2u is at its site, and we
answered some question in issues, and at stackoverflow. More questions
are always welcome!
If you like this or other open-source work I do, you can now sponsor me at
GitHub.
bspm making
package installation to the sysstem so seamless.This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Originally posted 2023-08-13, minimally edited 2023-08-15 which changed the timestamo and URL.
Mexico s education sector had one of the longest lockdowns due to COVID: As
everybody, we went virtual in March 2020, and it was only by late February
2022 that I went back to teach presentially at the University.
But for the semester starting next Tuesday, I m going back to a full-online
mode. Why? Because me and my family will be travelling to Argentina for six
months, starting this October and until next March. When I went to ask for my
teaching to be frozen for two semesters, the Head of Division told me he was
actually looking for teachers wanting to do distance-teaching With a student
population of >380,000 students, and not being able to grow the physical
infrastructure, and with such a big city as Mexico City, where a person can take
ove 2hr to commute daily It only makes sense to offer part of the courses
online.
To be honest, I m a bit nervous about this. The past couple of days, I ve been
setting up again the technological parts (i.e. spinning up a Jitsi instance,
remembering my usual practices and programs). But Well, I know that being
videoconference-bound, my teaching will lose the dynamism that comes from
talking face to face with students. I think I will miss it!
(but at the same time, I m happy to try this anew: to go virtual, but where
students choosing this modality do so by choice rather than because the world
forced them to)
About a week back Jio launched a 

Unlike the Americans who chose the path to have more competition, we have chosen the path to have more monopolies. So even though, I very much liked Louis es 




A long time ago, around the turn of the century, I was looking at some Useful Origami website and found a pattern for a document folder with a lot of pockets.
And by a lot of pockets I really mean a lot! I immediately had to fold one, and then another one, and then a few others, both in a size suitable for business cards and as a folder for A4 sheets of paper.
And then, a few years ago I needed a new document folder, and looked for these instructions, and couldn t find them anywhere. Luckily I still had some of the folders I had made, and the model was simple enough that I could unfold those and reconstruct the instructions.
I tried to show them around to see if anybody knew where it came from, but had no results.




Since some time I ve been thinking about making myself a top or a dress with a wide gathered neckline that can be work at different widths, including off-the-shoulders.
A few years ago I ve been gifted a cut of nice, thin white fabric with a print of lines and lozenges that isn t uniform along the fabric, but looks like it was designed for some specific garment, and it was waiting in my stash for a suitable pattern.
And a few days ago, during a Sunday lunch, there was an off-hand mention of a dress from the late 1970s which had an elastic in the neckline, so that it could be optionally worn off-the-shoulders.
And something snapped in place.
I had plans for that afternoon, but they were scrapped, and I started to draw, measure, cut rectangles of fabric, pin and measure again, cut more fabric.
The part of the fabric with large vertical stripes had two different widths: I could have made the back narrower, but I decided to just keep a strip with narrower lines to one side.
The fabric also didn t have a full second strip of lozenges, so I had to hem it halfway through it.
The casing for the elastic was pieced from various scraps, but at least I was able to match the lines on the center front and back, even if they are different. Not that it matters a lot, since it s all hidden in the gathering, but I would have known.
And since I was working on something definitely modern, even if made out of squares and rectangles, of course I decided to hand-sew everything, mostly to be able to use quite small sewing allowances, since the fabric was pretty thin.
In my stash I had a piece of swimsuit elastic that feels nice, looks nice and makes a knot that doesn t slip, so I used it. It s a perfect match, except for the neon yellow colour, which I do like, but maybe is a bit too high visibility? I will see if the haberdasher has the same elastic in dark blue, but right now this will do.
It was a quick project anyway: by the end of the working week the top was finished; I think that on a sewing machine it would be easy to make it in a day.
And it can be worn off the shoulders! Which is something I will probably never do in public (and definitely not outdoors), but now if I wanted I could! :D
As usual, the pattern (for what pattern there is) and instructions are 


































I've 







This post describes how to deploy 

The phrase "Root of Trust" turns up at various points in discussions about verified boot and measured boot, and to a first approximation nobody is able to give you a coherent explanation of what it means[1]. The Trusted Computing Group has a fairly wordy 
I have had the pleasure to have Poha in many ways. One of my favorite ones is when people have actually put tadka on top of Poha. You do everything else but in a slight reverse order. The tadka has all the spices mixed and is concentrated and is put on top of Poha and then mixed. Done right, it tastes out of this world. For those who might not have had the Indian culinary experience, most of which is actually borrowed from the Mughals, you are in for a treat.
One of the other things I would suggest to people is to ask people where there can get five types of rice. This is a specialty of South India and a sort of street food. I know where you can get it Hyderabad, Bangalore, Chennai but not in Kerala, although am dead sure there is, just somehow have missed it. If asked, am sure the Kerala team should be able to guide.
That s all for now, feeling hungry, having dinner as have been sharing about cooking.