knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of package "quantiles" is to supply the tool for calculating theoretical quantiles of the data and therefore could be used for diagnosing the distribution of the data.
devtools::install_github("Seren1127/quantiles")
This is a basic example which shows you how to solve a common problem:
library(quantiles) data<-rnorm(3) normal_scores(data)
set.seed(1) data<-rnorm(30) results<-normal_scores(data) plot(results$normal_score, results$standard_score, xlab = "Theoretical Quantiles", ylab = "Sample Quantiles", main = "Normal Q-Q Plot") qqnorm((data-mean(data))/sd(data)) # results in same plot
I created this package by following steps.
devtools::create_package("quantiles") library(devtools) library(roxygen2) use_git() use_r("normal_scores")
In this step, I created R package project by devtools::create_package
.
Also, normal_scores.R
was created by use_r
and this contains the function content.
I created README and rendered it by following commands.
use_readme_rmd() build_readme()
I made tests for normal_scores
by use_test
.
use_test("normal_scores") test() # Tests all tests in `tests` folder.
Finally, I made and edited documentations, including DESCRIPTION, Roxygen, and vignette for usage of normal_scores
.
Also, this package has the dependency on stats
package, so import that package by using use_package
# Code -> Insert Roxygen Skeleton document() use_mit_license("Seren Lee") use_package("stats") use_vignette("normal_scores") build_vignettes()
To check the package,
check()
cscores
in exactRankTests
is also possible to return the normal scores.
But since this function uses different order statistics, so the output is slightly different.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.