0
output$GraphPlot1 <- renderPlot({

  par(fig=c(0.2,1,0,0.8), mar = c(2,0,0.1,2), new=TRUE)
  ggplot(table.years,aes(table.years[[2]],table.years[[1]]))+geom_line(color="blue", size = 1.5)+geom_line(aes(table.years[[3]],table.years[[1]]),color="black", size = 1.5)+
    geom_line(aes(table.years[[4]],table.years[[1]]),color="green", size = 1.5)+geom_line(aes(table.years[[5]],table.years[[1]]),color="red", size = 1.5)+
    geom_line(aes(table.years[[6]],table.years[[1]]),color="Yellow", size = 1.5)+
    labs(x = "Percent",
         y = "years")


})

Hello, I am trying to create an interactive chart with the code below. I have as input parameters: the standard deviation, the number of realizations and the autocorrelation distance.

table.years is a table containing percentages based on years. I would like my graph to change when these settings change. Would you know how I could go about it please?

I display 5 columns of my table in the same graph, the first column contains the years and the 5 others the percentages.

ktiu
  • 2,606
  • 6
  • 20
Lili
  • 1
  • 1
  • Welcome! It would be helpful if you could provide us with a reproducible [minimal working example](https://en.wikipedia.org/wiki/Minimal_working_example) that we can copy and paste to better understand the issue and test possible solutions. You can share datasets with `dput(YOUR_DATASET)` or smaller samples with `dput(head(YOUR_DATASET))`. (See [this answer](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example#5963610) for some great advice.) – ktiu Jun 22 '21 at 14:44
  • x <- read.table(text = " year 1.per.mille 2.per.mille 3.per.mille 24 472 128 54 25 438 118 50 26 408 108 46 27 382 100 44 ", header = TRUE) – Lili Jun 23 '21 at 08:45
  • Hello, Sorry for not putting the data. Here is part of the table.years and part of my ui code : ui <- fluidPage( # Sidebar layout with input and output definitions ---- sidebarLayout( sidebarPanel( sliderInput("stdev", h3("standard deviation (kg/m2"), min = 0.01, max = 20, value = 0.5, step = 0.1), fluidRow( column(3, numericInput(inputId ="nsim", h3("number of realisations"), min=1,max=100, value = 2)) ) – Lili Jun 23 '21 at 08:50

0 Answers0