Created
November 25, 2014 11:01
-
-
Save abikoushi/6359c379f2898744e531 to your computer and use it in GitHub Desktop.
はてな記法の表を出力する関数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hatena <- function(x){ | |
cn1 <- NULL | |
if(!is.null(colnames(x))) cn1 <- paste("|*",colnames(x)) | |
dim1 <- dim(x) | |
x <- apply(x, 2,as.character) | |
x <- paste("|",x) | |
dim(x) <- dim1 | |
if(is.null(cn1)){ | |
write.table(x, quote=FALSE,col.names=FALSE, row.names=FALSE, eol="|\n") | |
}else{ | |
colnames(x) <- cn1 | |
write.table(x, quote=FALSE, row.names=FALSE, eol="|\n")} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see also
xtable
kable