RStudio - publishing html outputs from rmarkdown

Has anyone used Rstudio workbench in Code Workspaces, and if so, have you published a html output from an rmarkdown script? if so, could you tell me the steps you followed as some of my colleagues and myself have not been able to do this.
Many thanks.

Hi MichelleW!

I recommend checking out our docs on publishing RMarkdown reports: https://www.palantir.com/docs/foundry/code-workspaces/rstudio. Let me know if this is what you’re looking for, and if so if you run into any issues along the way.

Hi Caleb, thanks for the link. I have managed to read in a dataset to a RMarkdown and output a dataset. However I can’t manage to publish a html output from RMarkdown. Could you possibly talk me through it? I can then pass it on to others with the same issue. many thanks, Michelle

Hi MichelleW,

First you’ll want to head to the ‘Reports’ UI:


and install any necessary packages

Follow the flow to “Create a new report” - which will ask you to select an Rmd file. You should also add any dataset inputs that are used in the RMarkdown report.

Complete the flow, and a report will be built + published from your workspace. You can view the report by clicking on it from the ‘Reports’ panel. It will look something like this:

Let me know if there’s anything else I can clarify!

Hi Caleb :),

Thanks for your reply!
Question about installing packages - is this the best way to install packages? This is for a rmarkdown file.

#renv is recommended to install
#Look out for Y/N prompts in the Console
renv::install(“foundry”)#this is the palantir r sdk from CRAN
renv::install(“rmarkdown”)#not sure if this is needed
renv::install(c(“dplyr”, “tidyr”))#tidyverse is not available
renv::install(“knitr”)

many thanks, Michelle
Update - I think I’ve answered my own question from a colleague, I understand we can use
the Reports button on the left which seems to give all the main packages from CRAN.

Hi again Caleb,

From your initial reply, I think the steps have been updated since they were written, the steps I took:

Created the RMarkdown file, including loading dataset via the Data Tab
Went to the Reports tab
Clicked ‘Add’
Filled in the ‘Publish a report’ dialogue box
Create
Then I ran the code to ‘View published report’ and I then got an error message, saying the file was too large, but it wasn’t, its a very small dataset (~8k rows).
It also said it was an untrusted html.
The error code:

[Error] {"errorCode":"INVALID_ARGUMENT","errorName":"DataProxy:FileTooLarge","errorInstanceId":"dd1ca072-d467-45e4-91d5-eb090b70bf16","parameters":{"datasetRid":"ri.foundry.main.dataset.62a660ed-e13c-4c97-b4b8-3f8d13e50684","path":"/datasets/ri.foundry.main.dataset.62a660ed-e13c-4c97-b4b8-3f8d13e50684/transactions/ri.foundry.main.transaction.0000091b-5bca-d737-b46a-de662cadb661/rmarkdown.html","fileSize":"660119"}}

Please can you give me some advice on this, or talk me through it?
Many thanks, Michelle

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.