On 07/05/2012 10:37 PM, purushothaman wrote:
Hi,
i am new in R development ,
so i need help in documentation from comments in R file
for example
sample<-function(filepath)
{
##title<< read csv file
##author<< Purushoth
##description this function is used to read a csv file
output<-read.csv(filepath)
return(output)
}
i need to get html document file using this comments
Hi B.Purushothaman,
Does this do what you want?
instream<-file("sample.R","r")
sample.txt<-readLines(instream)
close(instream)
library(prettyR)
delim.table(
as.matrix(sample.txt[grep("##",sample.txt,fixed=TRUE)]),
html=TRUE,label="Doc for sample.R")
<html><body>
Doc for sample.R</tr>
<table border=1>
</tr>
<tr><td> ##title<< read csv file</tr>
<tr><td> ##author<< Purushoth</tr>
<tr><td> ##description this function is used to read a csv file</tr>
</table>
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.