At its simplest, an R package is any directory containing a file called DESCRIPTION. There's more to it, of course to do anything useful. A careful read of R Packages will get you through the details, and is probably worth buying in paper if you plan on doing this often.
Well, after years of avoiding it, I was finally about to create a package to gather up all my miscellaneous functions for I wouldn't have to search all over for them. We could work together along those lines.
The javascript part of it is thankfully easy if you like the way that collapsibleTree tree works--it's just a matter
install.packages("collapsibleTree")
and making that a dependency.
If you'll take the first cut with an empty project following the Wickham book, so we can track each other, this will be a good learning experience for both of us.
It's late here in Seattle, WA USA and I'm about to turn in for the night. When you're ready, just edit one of your posts and it will automagically pop up in my unread folder here.