Don't know if this would help, but you could always set an attribute
of alphatab to be the dimnames. See ?attrib . Of course you would then
have to write a custom print() function, possibly along the lines you
indicated.
You could also do this via S3 (or whatever) classes, of course. But
again, no
Hi jpm miao,
After a fair stretch of fooling around with it, I can't see any way to
add the variable names ("varnames") to the output of delim.table
without breaking it for things other than table objects. You can
probably do this as a one-off hack by setting the names of the
dimnames of the "count
Thanks.
Could we print the row/column names, "alpha1" and "alpha2" to the csv file?
2016-04-30 17:06 GMT-07:00 Jim Lemon :
> Hi jpm miao,
> I think you can get what you want like this:
>
> alpha1<-sample(LETTERS[1:3],50,TRUE)
> alpha2<-sample(LETTERS[1:2],50,TRUE)
> alphas<-data.frame(alpha1,alph
Hi jpm miao,
I think you can get what you want like this:
alpha1<-sample(LETTERS[1:3],50,TRUE)
alpha2<-sample(LETTERS[1:2],50,TRUE)
alphas<-data.frame(alpha1,alpha2)
library(prettyR)
alphatab<-xtab(alpha1~alpha2,alphas)
sink("temp_table3.csv",append=TRUE)
delim.xtab(alphatab,pct=NA,delim=",")
sink
Jim,
Thanks for creating such a fantastic package "prettyR".
I want to print the pretty frequency table (with row total and column
total) to an excel (or csv ) file. Is it possible?
>alphatab
A B Total
A 8 10 18
B 7 5 12
C 9 11 20
Total 24 26 50
Two issues I encountered (See the attache
Hi jpm miao,
You can get CSV files that can be imported into Excel like this:
library(prettyR)
sink("excel_table1.csv")
delim.table(table(df[,c("y","z")]))
sink()
sink("excel_table2.csv")
delim.table(as.data.frame(table(df[,c("y","z")])),label="")
sink()
sink("excel_table3.csv")
delim.table(as.mat
Hi,
How could we print the frequency table (produced by "table") to an Excel
file?
Is there an easy way to do so? Thanks,
Miao
> df <- data.frame(x = 1:3, y = 3:1, z = letters[1:3])
> table(df[,c("y","z")])
z
y a b c
1 0 0 1
2 0 1 0
3 1 0 0
> test<-table(df[,c("y","z")])
> as.d
7 matches
Mail list logo