Snippets

Dénes Türei Normality test

Created by Dénes Türei
#!/usr/bin/env Rscript

# Dénes Türei EMBL 2018
# turei.denes@gmail.com

require(readxl)
require(ggplot2)

infile <- 'ND_test.xls'
pdf_density <- 'density.pdf'
pdf_qqplot  <- 'qqplot.pdf'

data <- read_xls(infile, col_names = FALSE)

p <- ggplot(data, aes(X__1)) +
    geom_density() +
    xlab('Values') +
    ylab('Density') +
    theme_linedraw()

ggsave(pdf_density, device = cairo_pdf, width = 4, height = 4)

p <- ggplot(data, aes(sample = X__1)) +
    geom_qq() +
    xlab('Theoretical') +
    ylab('Sample') +
    theme_linedraw()

ggsave(pdf_qqplot, device = cairo_pdf, width = 4, height = 4)

shapiro.test(data$X__1)

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.