0

I want to create plot displaying the relationship between all the variables in a data set, and I think the pairplot is the most suistable. I have some problem in creating the shinyApp related to it.

I was able to create in the "ui" a check box containing all the names of the variables. But in the server I find some problems.

I would like to be able to get as a result a ShinyApp containing the pairplot of the variables I have selected when I open the App.

Mary
  • 47
  • 6
  • 2
    It's very hard for anyone to read your post and help you find a solution. I'd recommend trying to code up a pairplot in a shiny app with a simple dataset, maybe built in data like `iris`, then post the error as a question. Then people would have something to go off of. Check out this resource on producing a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – astrofunkswag Dec 19 '18 at 18:33
  • I have tried to use the iris dataset, my code is under in the comments. I came up with other problems in the UI part as well now. – Mary Dec 19 '18 at 19:39

1 Answers1

0

Server Code:

ShinyServer(function(input, output,session) {
output$plot_id_in_ui <- renderplot( {
pairplot(object, varnames, type = "both",penalty.par.val = "lambda.1se", 
nvals = c(20, 20),pred.type = "response")
                                      } ) 
})
Chabo
  • 2,842
  • 3
  • 17
  • 32
  • library(shiny) library(plotly) data(iris) ui<-fluidPage( titlePanel("Iris"), sidebarLayout( sidebarPanel( selectInput("var",label="Choose a variable", choice=list("Sepal.Length"=1, "Sepal.Width"=2, "Petal.Length"=3, "Petal.Width"=4, "Species"=5), selectize=FALSE), checkboxGroupInput(inputId ="independent",label = "Select independent variables", choices = names(iris)), mainPanel( verbatimTextOutput("sum"), plotlyOutput('plot_id_in_ui ', height = "900px") ) )) ) – Mary Dec 19 '18 at 19:33
  • The one I have uploaded put is my UI, but every time I run it, it says: "Error in sidebarLayout(sidebarPanel(selectInput("var", label = "Choose a variable", : argument "mainPanel" is missing, with no default".. Do you know why? thanks in advance – Mary Dec 19 '18 at 19:34