[英]How to print different dataframes based of user input? Rmarkdown/Shiny
我試圖讓用戶 select 有一個數據框,然后將其呈現為表格。
這是我的代碼。
---
title: "Untitled"
date: "2/24/2022"
output: html_document
runtime: shiny
---
```{r}
selectInput(inputId = "dataset",label = "Choose Data Frame", choices = c(mtcars, iris, cars))
renderTable({
dataset <- get(input$dataset, choices = c(mtcars, iris, cars))
})
```
盡管出於某種原因,輸入是每個數據集的列名。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.