Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Brendan Halpin
Brendan Halpin
@bthalpin@mastodon.social  ·  activity timestamp last week

Everyday #Emacs #orgmode task: merge two tables

I'm grading, and want to merge the class list with the list of assignment submissions. Include the two lists as named tables, and a tiny R-snippet will produce a merged table (also named).

Screenshot of Emacs buffer. Contents:
#+NAME: classlist
| sname     | fname |       ID |
|-----------+-------+----------|
| Doe       | John  | 22339574 |
| Belafonte | Harry | 23420537 |
| Show      | No    | 24135666 |

#+name: submissions
|       ID | timestamp              |
|----------+------------------------|
| 22339574 | 19 December 2025 17:59 |
| 23420537 | 19 December 2025 10:53 |

#+name: results
#+begin_src R :var students=classlist subs=submissions
library(dplyr)
left_join(students, subs, by='ID')
#+END_SRC

#+RESULTS: results
| Doe       | John  | 22339574 | 19 December 2025 17:59 |
| Belafonte | Harry | 23420537 | 19 December 2025 10:53 |
| Show      | No    | 24135666 |                        |
Screenshot of Emacs buffer. Contents: #+NAME: classlist | sname | fname | ID | |-----------+-------+----------| | Doe | John | 22339574 | | Belafonte | Harry | 23420537 | | Show | No | 24135666 | #+name: submissions | ID | timestamp | |----------+------------------------| | 22339574 | 19 December 2025 17:59 | | 23420537 | 19 December 2025 10:53 | #+name: results #+begin_src R :var students=classlist subs=submissions library(dplyr) left_join(students, subs, by='ID') #+END_SRC #+RESULTS: results | Doe | John | 22339574 | 19 December 2025 17:59 | | Belafonte | Harry | 23420537 | 19 December 2025 10:53 | | Show | No | 24135666 | |
Screenshot of Emacs buffer. Contents: #+NAME: classlist | sname | fname | ID | |-----------+-------+----------| | Doe | John | 22339574 | | Belafonte | Harry | 23420537 | | Show | No | 24135666 | #+name: submissions | ID | timestamp | |----------+------------------------| | 22339574 | 19 December 2025 17:59 | | 23420537 | 19 December 2025 10:53 | #+name: results #+begin_src R :var students=classlist subs=submissions library(dplyr) left_join(students, subs, by='ID') #+END_SRC #+RESULTS: results | Doe | John | 22339574 | 19 December 2025 17:59 | | Belafonte | Harry | 23420537 | 19 December 2025 10:53 | | Show | No | 24135666 | |
  • Copy link
  • Flag this post
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-alpha.41 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct