I'm making a table using formattable and I'd like to hide the column titles for the descriptive columns.
So for example, for dataframe "df" I'd like the resulting table to only show the column titles for msmt1, 2, and 3 and then have blank title names for the "site" and "variable" columns.
library(formattable)
df<-data.frame("site" = rep(c("1", "2"), 3),
"variable" = c("C", "C", "O", "O", "N", "N"),
"msmt1" = runif(6),
"msmt2" = runif(6),
"msmt3" = runif(6))
formattable(df)
Replacing the df column names with " " makes them show up as "X." in the table.
Is this possible in formattable?
How about this:
formattable(df, col.names = c("","","msmt1", "msmt2", "msmt3"))