This function formats a data frame of articles into a markdown-styled table using the tinytable
package.
It allows you to select specific columns from the article data and adjust the column widths for a clean, formatted output.
Value
A formatted markdown table as a character string, ready to be displayed in markdown-supported environments.
Details
The function first ensures that the specified columns exist in the data frame and that the length of cols
matches the length of width
.
It then formats the "title" column as a markdown link, using the article's URL (if provided), and selects the requested columns to be displayed in the table.
The resulting table is formatted as markdown for easy integration into markdown environments.
Examples
if (FALSE) { # \dontrun{
papers <- get_articles(journal = "Nature Biotechnology")
papers_with_summary <- add_summary(papers)
tt_article(papers_with_summary)
} # }