library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.3 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.4 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.0
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
plants <- read_csv("Plants.csv")
## Rows: 100 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Fert
## dbl (5): BiomassT1, BiomassT2, Row, Column, Species
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
plants |>
ggplot() +
geom_point(aes(x = BiomassT1,
y = BiomassT2))

library(shiny)
ui <- fluidPage(
sliderInput("slider1",
"Slide",
0,
400,
c(0,400)),
plotOutput("plot1")
)
server <- function(input, output, session) {
output$plot1 <- renderPlot({
plants |>
filter(between(BiomassT2, input$slider1[1], input$slider1[2])) |>
ggplot() +
geom_tile(aes(x = Row,
y = Column,
fill = BiomassT2)) +
lims(x = c(0,10),
y = c(0, 10))
})
}
shinyApp(ui, server)
Shiny applications not supported in static R Markdown documents