Closed pbahr closed 8 years ago
Could you provide a minimal example?
library(printr)
a <- c(T,F)
b <- factor(1:3)
c <- c("V", "W", "X", "Y", "Z")
d <- 1:100
df <- data.frame(cbind(a,b,c,d))
tab <-table(df$a, df$b, df$c)
tab
prop.table(tab)
"Freq" makes sense for the column name of the first table (tab), but not for the second table (prop.table). I would like to name it "Proportion", but not sure if it's possible.
OK, I see what you mean now. I provided one possible solution in the current devel version of printr, although I don't quite like the syntax:
```{r}
library(printr)
a <- c(T,F)
b <- factor(1:3)
c <- c("V", "W", "X", "Y", "Z")
d <- 1:100
df <- data.frame(cbind(a,b,c,d))
tab <-table(df$a, df$b, df$c)
tab
prop.table(tab)
Thanks, @yihui for the workaround. That would solve it for now.
Thanks for the useful package. I'm printing a 3-dimensional table as the result of
prop.table()
call. In the code,as.data.table()
is called for high-dimensional tables, which usesresponse.name= "Freq"
by default. "Freq" response name is misleading in my case, but I don't think there is a way to change it.