パラメータを加味した相関係数Shiny
— ZEO (@ZENOOcom) April 22, 2020
YoutubeでGUI操作をあげました。コードはQiitaに記載してますhttps://t.co/sapcNWa4Vv @YouTubeさんから
library(shiny)
df<-read.csv('1.csv',header=TRUE,fileEncoding = "UTF-8-BOM")
ui<-fluidPage(
titlePanel("Telephones by region"),
sidebarLayout(
sidebarPanel(
selectInput("region1", "X:",
choices=colnames(df)),
selectInput("region2", "Y:",
choices=colnames(df)),
checkboxGroupInput("well","WellID:",
choices=df[,2])),
mainPanel(
plotOutput("phonePlot"),
verbatimTextOutput("comand"),
verbatimTextOutput("comand1"),
verbatimTextOutput("comand2")
)
)
)
server<-function(input, output) {
output$phonePlot <- renderPlot({
plot(df[input$well,input$region1], df[input$well,input$region2],
main=input$region,
ylab="Y",
xlab="X")
})
output$comand<-renderPrint(cor(df[input$well,input$region1], df[input$well,input$region2]))
output$comand1<-renderPrint(cor.test(df[input$well,input$region1], df[input$well,input$region2]))
output$comand2<-renderPrint(summary(lm(df[input$well,input$region1]~df[input$well,input$region2])))
}
shinyApp(ui = ui, server = server)