Knoter is an accessory library to the venerable Knitr that allows you to take your reports generated in R, and send them in to OneNote. Not only can the reports be synced up to OneNote, but any accessory data, such as the original figures in PDF format, as well as data frames wrapped into an excel format, can all be sent along for the ride. This gives all the data necessary for turning an analysis into a set of figures for publication, or data sheets to go with the publication.
The development version of the tool can be installed using devtools
Rhtml) or R Markdown (
A single command will upload your report to OneNote
knoter::knote('example.Rhtml',notebook='My Notebook',section='My Section')
Knoter will log in to OneNote for you, asking for permissions to write to your OneNote notebooks.
Or, if you'd like to append some Markdown to a page
my_markdown = "## Header\n\n This is some inline R `r 1+1`.\n" knoter::knote.append(text=my_markdown,notebook='My Notebook',section='My Section',page='My Page')
This will append a header, and a paragraph with some inline R to the page
When sharing reports for datasets there are two important artefacts that often have a life beyond the
original report that they are embedded in. Tabular data and generated figures are often either embedded
within other things (such as manuscripts). To make this easier, there are three functions that can be
used within a code block,
If you want to attach an Excel workbook with sets of tabular data to your OneNote, you can use this function to write the Excel workbook.
If you have tabular data that you would like OneNote to display properly, you can use the table function, which will add the correct formatting to show a table in OneNote.
If you have a lot of plots that you want to generate as PDF and attach to OneNote, but don't actually want to have an image inserted for every one of them, you can use this function to tell knoter to write the multipage PDF and then only insert an image for the first plot
# Only plot1 will appear in the output multipage(list(plot1,plot2,plot3))
If you have your notebooks sitting on a SharePoint library, you can ask knoter to write to that location with the
knoter::knote('example.Rhtml',notebook='My SharePoint Notebook',section='My Section',sharepoint="https://hostname.sharepoint.com/sites/MySite")
OneNote only supports a subset of HTML for uploading into their notebooks. As long as you stick to a relatively simple subset of tags (see: Tag support), the upload should work. Inline style attributes are likely to be removed, so don't count on the availability of styling.
The full list of supported tags can be found at the OneNote API description
| Supported Tag |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.