Parameterized report with file input on Posit Connect

Hi,

I am reposting this issue from here, here and here as it has currently 5 years since the issue was first reported, the bug is still present and the most recent post is not being answered to anymore.

In short, whenever the data:input:file parameter is used in a parameterized report that is published on Posit Connect, the report crashes with error ! '/opt/rstudio-connect/mnt/tmp/RtmpnmvlZN/file493ae4b2f59d3/0.csv' does not exist.. This makes the parameterized reports functionality near useless, whereas otherwise it would be an amazing addition to our infrastructure.

Is there any timeline available when this issue is to be resolved?

My reprex:

---
title: "Parameterized Report"
author: "Your Name"
date: "`r Sys.Date()`"
output: html_document
params:
  cylinders: 4
  analysis_type: "histogram"
  data:
    label: "Csv file"
    value: "cars.csv"
    input: file
---

```{r setup, include=FALSE}
# Load necessary libraries
library(dplyr)
library(ggplot2)

# Load the dataset specified by the parameter
data <- readr::read_csv(params$data)

# Filter data based on the parameter for the number of cylinders
filtered_data <- data %>% filter(cyl == params$cylinders)
```

```{r}
head(filtered_data)
```

```{r}
if (params$analysis_type == "summary") {
  summary(filtered_data)
} else if (params$analysis_type == "histogram") {
  ggplot(filtered_data, aes(x = mpg)) +
    geom_histogram(binwidth = 2) +
    ggtitle(paste("Distribution of MPG for", params$cylinders, "Cylinders"))
}
```

Note that this does work locally, and the report will initially publish, but when uploading mtcars (exported as cars.csv) manually and running the report we observe the bug.

Hi @Kobus,

Thanks for the comprehensive report. I apologise we haven't answered this more openly and sooner.

In short:

  • We don’t support file upload inputs for parameterized R Markdown.
  • We will review our documentation and make sure it is explicit that this isn't supported.

Depending on what you are wanting to upload into the parameterized report, could the pins package be an option for passing data into the report?

https://docs.posit.co/connect/user/pins/

Thank you @Lachlan_Simpson, clear!

1 Like

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.