scatterplot_con_sig: scatterplot_con_sig

Usage Arguments Examples

View source: R/scatterplot_con_sig.R

Usage

1
scatterplot_con_sig(select, variable, testdata, folder, method = "kendall")

Arguments

select
variable
testdata
folder
method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (select, variable, testdata, folder, method = "kendall") 
{
    dir.create(path = folder, showWarnings = FALSE)
    library("ggpubr")
    library("ggplot2")
    p <- ggscatter(testdata, x = variable, y = select, add = "reg.line", 
        conf.int = TRUE, cor.coef = TRUE, cor.method = method, 
        cor.coef.size = 8, xlab = variable, ylab = select) + 
        theme_bw() + theme(plot.title = element_text(size = 30, 
        face = "bold"), legend.title = element_text(size = 30), 
        legend.text = element_text(size = 16)) + theme(axis.line = element_line(colour = "black"), 
        panel.grid.major = element_blank(), panel.border = element_blank(), 
        panel.background = element_blank(), axis.line.x = element_line(color = "black", 
            size = 1), axis.line.y = element_line(color = "black", 
            size = 1), axis.text = element_text(size = 16, face = "bold"), 
        axis.title = element_text(size = 20, face = "bold"))
    p
    ggsave(filename = paste(folder, "/", select, ".pdf", sep = ""), 
        width = 10, height = 7)
    return(select)
  }

LyonsZhang/ProgPerm documentation built on July 16, 2020, 12:45 a.m.