I'm new to making tables in R and using html. I have R on two different laptops, and when working on one of the computers, when I use htmlTable, xtable, etc, a table appears in the viewer on the ride side of RStudio. However, on the other computer, no table displays in the viewer but html code appears in the console. Is there another package I need to render the html? I'm not using Markdown or anything, I just want to see simple tables using htmlTable in the viewer instead of the code.
I'm not sure how to make this reproducible, so I'm hoping someone knows the answer. On the computer that shows the actual table in the viewer, all I do is load the htmlTable package, and it works.
What am I missing? Is it related to my computer's settings, version of RStudio, etc?
xtablejust returns HTML code, which you can then insert into your document. Among others,knitr::kableand most LaTeX formatters do the same. Some packages generate a complete HTML widget that will display in the viewer, e.g. DT.print.htmlS3 method and it is taking the lead forprinting since the class forhtmlTableobjects isc("html", "htmlTable", "character"). OP shld debug that OR doclass(object_returned_from_call_to_htmlTable) <- c("htmlTable", "html", "character")before just callingprint()OR explicitly callhtmltools::html_print(object_returned_from_call_to_htmlTable)to achieve consistency in RStudio Viewer pane usage across their systems.