An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081205/e2792673/attachment.pl>
xtable html links
3 messages · Tim Smith, Liviu Andronic, Gabor Grothendieck
On Fri, Dec 5, 2008 at 9:43 PM, Tim Smith <tim_smith_666 at yahoo.com> wrote:
I was trying to get hyperlinks using xtable, but couldn't get the hyperlinks to function properly. For example, if I use
Perhaps hwriter [1] could be of use. Check its home page. Liviu [1] http://cran.at.r-project.org/web/packages/hwriter/index.html
Do you know how to read? http://www.alienetworks.com/srtest.cfm Do you know how to write? http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
Try this: print(xtable(mat2), type = "html", file = "test.html", sanitize.text.function = force)
On Fri, Dec 5, 2008 at 3:43 PM, Tim Smith <tim_smith_666 at yahoo.com> wrote:
Hi, I was trying to get hyperlinks using xtable, but couldn't get the hyperlinks to function properly. For example, if I use ## Try to link NY times website to every figure in column 4 mat <- matrix(1:43,6,5) mat[,5] <- "http://nytimes.com" for(i in 1:nrow(mat)){ strr <- paste('<a href="', mat[i,5],'">', mat[i,4], '</a>', sep='') mat[i,4] <- strr } mat2 <- mat[,1:4] caption = 'test' mx <- xtable(mat2,caption=caption) tt = print(mx, type="html",include.rownames=F) tt1 <- gsub('lt /a','lt/a',tt,fixed=T) tt2 <- gsub('lt a','lta',tt1,fixed=T) write.table(tt2,'test.html',quote=F) However, if I open 'test.html' in IE, the hyperlinks don't seem to work. What am I doing wrong? thanks. [[alternative HTML version deleted]]
______________________________________________ R-help at 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.