Hi Martin,
thank you for the fast answer
I tried to preform a reprex, I hope it turned out well. I put together the stuff I learned from the shiny tutorial to make myself a template. this is how my app looks like at the moment:
library(shiny)
library(readr)
library(markdown)
#> Warning: Paket 'markdown' wurde unter R Version 3.5.2 erstellt
library(plotly)
#> Warning: Paket 'plotly' wurde unter R Version 3.5.2 erstellt
#> Lade nötiges Paket: ggplot2
#> Warning: Paket 'ggplot2' wurde unter R Version 3.5.2 erstellt
#>
#> Attache Paket: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
library(datasets)
library(data.table)
library(tidyverse)
#> Warning: Paket 'tidyverse' wurde unter R Version 3.5.2 erstellt
#> Warning: Paket 'tidyr' wurde unter R Version 3.5.2 erstellt
#> Warning: Paket 'dplyr' wurde unter R Version 3.5.2 erstellt
#> Warning: Paket 'stringr' wurde unter R Version 3.5.2 erstellt
#> Warning: Paket 'forcats' wurde unter R Version 3.5.2 erstellt
anreise2013 <- read_csv("anreise2013.csv")
#> Error: 'anreise2013.csv' does not exist in current working directory ('C:/Users/julie/AppData/Local/Temp/Rtmpsb5ylA/reprex3f2435231785').
# Define UI for app that draws a histogram ----
ui <- fluidPage(
# App title ----
titlePanel("Vorlage"),
# Sidebar layout with input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ----
sidebarPanel(
h3("Sidebar Panel"),
br(),
# Input Action Button
h4("Action Button"),
actionButton("action", label = "Action"),
hr(),
fluidRow(column(12, verbatimTextOutput("value1"))),
#Input dropdown selection box
selectInput("select", label = h4("Select box"),
choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3),
selected = 1),
hr(),
fluidRow(column(12, verbatimTextOutput("value2"))),
#Text input
textInput("text", label = h4("Text input"), value = "Enter text..."),
hr(),
fluidRow(column(12, verbatimTextOutput("value3"))),
# slider input
sliderInput("slider1", label = h4("Slider"), min = 1,
max = 6, value = 5),
hr(),
verbatimTextOutput("value4")
),
# Main panel for displaying outputs ----
mainPanel(
h3("Main Panel"),
#rendertext
p("rendertext function: you pushed the action button", textOutput("action_value1"), "times."),
#renderimage
p("renderImage function: (input: selection box)"),
imageOutput("numberimage"),
#rendertable
tabPanel("Table", DT::dataTableOutput("table")),
#plotoutput bar plot
plotOutput("anreisebar"),
#fonts and image input
img(src = "tree.png", align = "right"),
p("this is a paragraph // font test below"),
strong("bold text"),
em("italicized text"),
code("computer code style"),
div("blue text", style = "color:blue"),
div("green text", style = "color:green"),
p("some words in a different style with span",
span("some words", style = "color:orange"),
"that appear inside a paragraph.")
# Output:
)
)
)
# Define server logic required to draw a histogram ----
server <- function(input, output) {
#renderprint
output$value1 <- renderPrint({ input$action })
output$value2 <- renderPrint({ input$select })
output$value3 <- renderPrint({ input$text })
output$value4 <- renderPrint({ input$slider1 })
#rendertext
output$action_value1 <- renderText({ input$action })
#renderimage
output$numberimage <- renderImage({
if (is.null(input$select))
return(NULL)
if (input$select == "1") {
return(list(
src = "www/nr1.png",
contentType = "image/png",
alt = "1"
))
} else if (input$select == "2") {
return(list(
src = "www/nr2.png",
filetype = "image/png",
alt = "2"
))
}else if (input$select == "3") {
return(list(
src = "www/nr3.png",
filetype = "image/png",
alt = "3"
))
}
}, deleteFile = FALSE)
#Render Datatable
output$table <- DT::renderDataTable({
DT::datatable(anreise2013)
})
}
shinyApp(ui = ui, server = server)
Shiny applications not supported in static R Markdown documents
Created on 2019-01-29 by the reprex package (v0.2.1)
this is the csv I want to work with: https://drive.google.com/file/d/1DMAIpOT9k63iMn5Ou4gT9zby1EybN44U/view?usp=sharing