Skip to content

Commit

Permalink
respect new correlation method input
Browse files Browse the repository at this point in the history
  • Loading branch information
d-callan committed Nov 30, 2023
1 parent 7fa1da3 commit 08fd8df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ server <- function(input, output, session) {
shiny::observeEvent({
input$fileUpload
input$fileUpload2
input$correlationMethod
}, {
file1 <- req(input$fileUpload)
file2 <- input$fileUpload2
Expand All @@ -40,7 +41,7 @@ server <- function(input, output, session) {

lastData1ColIndex <- length(data1)
firstData2ColIndex <- length(data1) + 1
corrResult <- Hmisc::rcorr(as.matrix(data1), as.matrix(data2))
corrResult <- Hmisc::rcorr(as.matrix(data1), as.matrix(data2), type = input$correlationMethod)

# this bc Hmisc::rcorr cbinds the two data.tables and runs the correlation
# so we need to extract only the relevant values
Expand Down Expand Up @@ -110,7 +111,6 @@ server <- function(input, output, session) {
#edge_list <- cbind(edge_list, pVals[upper.tri(pVals)])

#colnames(edge_list) <- c("source","target","value","p_value")

return(edge_list)
})

Expand Down

0 comments on commit 08fd8df

Please sign in to comment.