I have a rmarkdown report, and below is the header
title: ""
author: ""
date: "`r Sys.Date()`"
output:
html_document:
keep_md: yes
theme: united
df_print: kable
editor_options:
markdown:
wrap: 72
params:
TP:
label: "Time Point"
input: select
choices: [3, 10, 22]
Integrated:
label: "Integrated"
value: TRUE
Inside the report, I need to extract the choices of the params$TP as a vector as follows.
if (params$Integrated == FALSE){
data=read.csv(paste0("DataATTimePoint", params$TP, ".csv")) } else {
data=lapply(params$TP$choices, function(x) read.csv(paste0("DataATTimePoint", x,".csv")))
data=do.call("rbind",data}
But it’s not the right way because (writing params$TP$choices is not correct). What is the right way to do this?
