I have a frequency table:
freq.tab <- as.table(rbind(c(1,2,3),c(4,5,6)))
I have assigned a function that would send this to Word using R2wd,
fun1 <- function(table){wdTable(table)}
fun1(freq.tab)
but I would like to add the table name freq.tab as a title.
Is there any way I can get R to print the table (or any value) name.
Basically, my output in Word should read something like:
freq.table
1 4
2 5
3 6
Obviously, I could do this with wdTitle("freq.table"), but I need something this would fit within the function and be called without resorting to quoted text.
You can get the name of the argument supplied using as.character(substitute(whatever_you_wanted))