Files in the top-level directory in any check-in
These are some names I played with:
aod :: arangment of data yat :: yet another table drc :: data in rows and columns rcd :: rows and columns data mft :: my friend's table mftf :: my friend's table functions rcd :: rows and columns data tbl :: table tay :: tables able :: a short table tapi :: table API apit :: API for tables yast :: yet another summary table yadt :: yet another descriptive table yalmt :: yet another lm table yalmert :: yet another lmer table dst :: descriptive statistics table
But then I realized there can't be one function
to do everything. For example, the code to generate
a table of descriptive statistics would be quite
different from the code to extract
and put it into a table.
So this is what I have
tossis a function to create a table of descriptive statisics
tolmcreates a table from an
Table of summary statistics
The formula interface would look like this:
toss(margin(group) + group + p(group) ~ mediqr(age) + npc(sex), data = dat)
mediqr (for median and IQR) and
npc (for number and
percent) are functions that calculate the desired summaries. These
could take up multiple rows in the table like this:
|Total||Group A||Group B||P-value|
|Age, median (IQR)|
|Sex, n (%)|
There can be some formating in functions like
the first argument being something like
This function and others like it have a
fmt argument that is similar
in spirit to the (first)
fmt argument of
mediqr(age, fmt = "%f (%f, %f)")
fmt string could be extended to encode stying
issues like alignment and border.
I guess these summary functions can return an object of
descriptive_statistic (or shorter name) and since the object has an
fmt element the print method can look at this element?
Table headers and caption
I can imagine something like this:
tods(group ~ mediqr(age, th = "Age, years"), data = dat, caption = "Summary table", header = ???
I don't know good syntax for the column headers. In HTML5 these
<tr> tags with a scope (I think).
What about this:
header = c(tr(th("Name", rowspan = 2), th("ID", rowspan = 2), th("Membership", colspan = 2), th("Balance", rowspan = 2)), tr(th("Joined"), th("Cancelled")))