Skip to content

Commit

Permalink
update cor_and_plot
Browse files Browse the repository at this point in the history
  • Loading branch information
lixiang117423 committed Jan 2, 2025
1 parent c70355e commit aee9e1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 70 deletions.
67 changes: 0 additions & 67 deletions NAMESPACE

This file was deleted.

4 changes: 2 additions & 2 deletions R/cor_and_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cor_and_plot <- function(data.1, data.2 = NULL, method = "pearson", cor = 0.6, p
tidyr::pivot_longer(cols = 2:ncol(.), names_to = "to", values_to = "pvalue") -> df.pvalue

dplyr::left_join(df.cor, df.pvalue) %>%
dplyr::filter(pvalue <= {{ pvalue }}, cor >= {{ cor }}, from != to) -> result.cor
dplyr::filter(pvalue <= {{ pvalue }}, abs(cor) >= {{ cor }}, from != to) -> result.cor
} else {
WGCNA::corAndPvalue(x = {{ data.1 }}, y = {{ data.2 }}, method = {{ method }}) -> cor.res

Expand All @@ -50,7 +50,7 @@ cor_and_plot <- function(data.1, data.2 = NULL, method = "pearson", cor = 0.6, p
tidyr::pivot_longer(cols = 2:ncol(.), names_to = "to", values_to = "pvalue") -> df.pvalue

dplyr::left_join(df.cor, df.pvalue) %>%
dplyr::filter(pvalue <= {{ pvalue }}, cor >= {{ cor }}, from != to) -> result.cor
dplyr::filter(pvalue <= {{ pvalue }}, abs(cor) >= {{ cor }}, from != to) -> result.cor
}

# return
Expand Down
2 changes: 1 addition & 1 deletion vignettes/cor_and_plot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ knitr::opts_chunk$set(
)
```

```{r, eval = FALSE}
```{r setup}
library(biohelpers)
```

0 comments on commit aee9e1b

Please sign in to comment.