Created
March 16, 2012 16:08
Revisions
-
ramnathv revised this gist
Mar 16, 2012 . No changes.There are no files selected for viewing
-
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 0 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +0,0 @@ -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ | A | B | C | |-------------- | ---------------- | ------------------| | asn_trans() | atanh_trans() | boxcox_trans() | | date trans() | exp trans() | identity trans() | | -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ | | | | |-------------- | ---------------- | ------------------ | | asn_trans() | atanh_trans() | boxcox_trans() | | date trans() | exp trans() | identity trans() | |-------------- | ---------------- | ------------------ | -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ | | | | +-------------- + ---------------- + ------------------ + | asn_trans() | atanh_trans() | boxcox_trans() | | date trans() | exp trans() | identity trans() | +-------------- + ---------------- + ------------------ + -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ | | | | |-------------- | ---------------- | ------------------ | | asn_trans() | atanh_trans() | boxcox_trans() | | date trans() | exp trans() | identity trans() | -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ | | | | |--------------|----------------|------------------| | asn_trans() | atanh_trans() | boxcox_trans() | | date trans() | exp trans() | identity trans() | -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,4 @@ |--------------|----------------|------------------| | asn_trans() | atanh_trans() | boxcox_trans() | | date trans() | exp trans() | identity trans() | |--------------|----------------|------------------| -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ | asn_trans() | atanh_trans() | boxcox_trans() | | date trans() | exp trans() | identity trans() | -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ Here is how you can make a table in GFM format using knitr + ascii ``` <!-- begin.rcode render_gfm() gfm_table <- function(x, ...){ @@ -11,8 +12,11 @@ gfm_table <- function(x, ...){ return(writeLines(y)) } end.rcode --> ``` ``` <!-- begin.rcode results = 'asis' x <- head(mtcars[,1:3]) gfm_table(x) end.rcode --> ``` -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 18 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1 +1,18 @@ Here is how you can make a table in GFM format using knitr + ascii <!-- begin.rcode render_gfm() gfm_table <- function(x, ...){ require(ascii) y <- capture.output(print(ascii(x, ...), type = 'org')) # substitute + with | for table markup # TODO: modify regex so that only + signs in markup, like -+- are substituted y <- gsub('[+]', '|', y) return(writeLines(y)) } end.rcode --> <!-- begin.rcode results = 'asis' x <- head(mtcars[,1:3]) gfm_table(x) end.rcode --> -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Here is how you can make a table in GFM format using knitr + ascii -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 17 additions and 13 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,19 +2,23 @@ ```r render_gfm() gfm_table <- function(x, ...) { require(ascii) y <- capture.output(print(ascii(x, ...), type = "org")) # substitute + with | for table markup # TODO: modify regex so that only + signs in markup, # like -+- are substituted y <- gsub("[+]", "|", y) return(writeLines(y)) } ``` ```r x <- head(mtcars[, 1:3]) gfm_table(x) ``` | | mpg | cyl | disp | |-------------------|-------|------|--------| @@ -23,4 +27,4 @@ | Datsun 710 | 22.80 | 4.00 | 108.00 | | Hornet 4 Drive | 21.40 | 6.00 | 258.00 | | Hornet Sportabout | 18.70 | 8.00 | 360.00 | | Valiant | 18.10 | 6.00 | 225.00 | -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 12 additions and 16 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,23 +2,19 @@ render_markdown() gfm_table <- function(x, ...) { require(ascii) y <- capture.output(print(ascii(x, ...), type = "org")) # substitute + with | for table markup # TODO: modify regex so that only + signs in markup, # like -+- are substituted y <- gsub("[+]", "|", y) return(writeLines(y)) } x <- head(mtcars[, 1:3]) gfm_table(x) | | mpg | cyl | disp | |-------------------|-------|------|--------| -
ramnathv revised this gist
Mar 16, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ```r gfm_table <- function(x, ...) { require(ascii) y <- capture.output(print(ascii(x, ...), type = "org")) @@ -12,7 +12,7 @@ gfm_table <- function(x, ...) { y <- gsub("[+]", "|", y) return(writeLines(y)) } ``` {% highlight r %} -
ramnathv created this gist
Mar 16, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ # Here is how you can make a table in GFM format using knitr + ascii {% highlight r %} gfm_table <- function(x, ...) { require(ascii) y <- capture.output(print(ascii(x, ...), type = "org")) # substitute + with | for table markup # TODO: modify regex so that only + signs in markup, # like -+- are substituted y <- gsub("[+]", "|", y) return(writeLines(y)) } {% endhighlight %} {% highlight r %} x <- head(mtcars[, 1:3]) gfm_table(x) {% endhighlight %} | | mpg | cyl | disp | |-------------------|-------|------|--------| | Mazda RX4 | 21.00 | 6.00 | 160.00 | | Mazda RX4 Wag | 21.00 | 6.00 | 160.00 | | Datsun 710 | 22.80 | 4.00 | 108.00 | | Hornet 4 Drive | 21.40 | 6.00 | 258.00 | | Hornet Sportabout | 18.70 | 8.00 | 360.00 | | Valiant | 18.10 | 6.00 | 225.00 | 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ #