Adding md2csv and tab2md functions.

This commit is contained in:
2024-10-11 10:42:29 +02:00
parent 0cb487caa4
commit a4483c84e6
4 changed files with 62 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
\name{md2csv}
\alias{md2csv}
\title{md2csv}
\usage{
md2csv(text, rm_blank =T)
}
\arguments{
\item{text}{An md text that you want to convert to csv. Note that you must eliminate the line that separates title from the rest.}
\item{text}{Bolean to specify if you want to remove spaces or not.}
}
\description{
This function converts an Markdown (md) table into csv format.
}
\examples{
text<-"|Letter|Number|
|A| 1|
|B| 2|
|C| 3|
|D| 4|
|E| 5|
|F| 6|
|G| 7|
|H| 8|
|I| 9|
|J|10|"
md2csv(text)
}
+17
View File
@@ -0,0 +1,17 @@
\name{tab2md}
\alias{tab2md}
\title{tab2md}
\usage{
tab2md(text)
}
\arguments{
\item{text}{A data.frame that you want to convert to Markdown.}
}
\description{
This function converts a data.frame into Markdown (md) format.
}
\examples{
table<-data.frame("Letter"=LETTERS[1:10], "Number"=1:10)
tab2md(table)
}