NEWS.md
- Added support for using unique()
on classes <rsi>
, <mic>
, <disk>
, <ab>
and <mo>
Added parameter excess
to the kurtosis()
function (defaults to FALSE
), to return the excess kurtosis, defined as the kurtosis minus three.
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: https://www.whocc.no/atc_ddd_index/
WHONET 2019 software: http://www.whonet.org/software.html
European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: http://ec.europa.eu/health/documents/community-register/html/atc.htm
-
-The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').
+The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
You can look for an antibiotic (trade) name or abbreviation and it will search x
and the antibiotics data set for any column containing a name or code of that antibiotic. Longer columns names take precendence over shorter column names.
-The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').
+The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable.
+Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable. A normal distribution has a kurtosis of 3 and a excess kurtosis of 0.
kurtosis(x, na.rm = FALSE) +kurtosis(x, na.rm = FALSE, excess = FALSE) # S3 method for default -kurtosis(x, na.rm = FALSE) +kurtosis(x, na.rm = FALSE, excess = FALSE) # S3 method for matrix -kurtosis(x, na.rm = FALSE) +kurtosis(x, na.rm = FALSE, excess = FALSE) # S3 method for data.frame -kurtosis(x, na.rm = FALSE)+kurtosis(x, na.rm = FALSE, excess = FALSE)
na.rm | -a logical value indicating whether |
+ a logical to indicate whether |
+
---|---|---|
excess | +a logical to indicate whether the excess kurtosis should be returned, defined as the kurtosis minus 3. |
-The lifecycle of this function is questioning. This function might be no longer be optimal approach, or is it questionable whether this function should be in this AMR
package at all.
+The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
Please suggest your own (country-specific) guidelines by letting us know: https://github.com/msberends/AMR/issues/new.
Note: Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu et al. in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this mdro()
function makes sure that results from before 2016 and after 2016 are identical.
-The lifecycle of this function is maturing. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome to suggest changes at our repository or write us an email (see section 'Contact Us').
+The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean.
-When negative: the left tail is longer; the mass of the distribution is concentrated on the right of the figure. When positive: the right tail is longer; the mass of the distribution is concentrated on the left of the figure.
+When negative ('left-skewed'): the left tail is longer; the mass of the distribution is concentrated on the right of a histogram. When positive ('right-skewed'): the right tail is longer; the mass of the distribution is concentrated on the left of a histogram. A normal distribution has a skewness of 0.
skewness(x, na.rm = FALSE) @@ -264,16 +264,17 @@ When negative: the left tail is longer; the mass of the distribution is concentr- na.rm -+ a logical value indicating whether
NA
values should be stripped before the computation proceeds.a logical value indicating whether
NA
values should be stripped before the computation proceedsQuestioning lifecycle
+Stable lifecycle
-+
-The lifecycle of this function is questioning. This function might be no longer be optimal approach, or is it questionable whether this function should be in thisAMR
package at all.+
+The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
Read more on our website!
diff --git a/docs/survey.html b/docs/survey.html index 02a307e6..097fcff8 100644 --- a/docs/survey.html +++ b/docs/survey.html @@ -81,7 +81,7 @@ diff --git a/man/as.ab.Rd b/man/as.ab.Rd index 1b1a6bb6..4c43ab8c 100644 --- a/man/as.ab.Rd +++ b/man/as.ab.Rd @@ -47,10 +47,12 @@ WHONET 2019 software: \url{http://www.whonet.org/software.html} European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm} } -\section{Maturing lifecycle}{ +\section{Stable lifecycle}{ -\if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} -The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. +\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} +The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. + +If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{WHOCC}{ diff --git a/man/guess_ab_col.Rd b/man/guess_ab_col.Rd index 87c56739..25e933ea 100644 --- a/man/guess_ab_col.Rd +++ b/man/guess_ab_col.Rd @@ -22,10 +22,12 @@ This tries to find a column name in a data set based on information from the \li \details{ You can look for an antibiotic (trade) name or abbreviation and it will search \code{x} and the \link{antibiotics} data set for any column containing a name or code of that antibiotic. \strong{Longer columns names take precendence over shorter column names.} } -\section{Maturing lifecycle}{ +\section{Stable lifecycle}{ -\if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} -The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. +\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} +The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. + +If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/kurtosis.Rd b/man/kurtosis.Rd index 60328e5d..c95be194 100644 --- a/man/kurtosis.Rd +++ b/man/kurtosis.Rd @@ -7,26 +7,30 @@ \alias{kurtosis.data.frame} \title{Kurtosis of the sample} \usage{ -kurtosis(x, na.rm = FALSE) +kurtosis(x, na.rm = FALSE, excess = FALSE) -\method{kurtosis}{default}(x, na.rm = FALSE) +\method{kurtosis}{default}(x, na.rm = FALSE, excess = FALSE) -\method{kurtosis}{matrix}(x, na.rm = FALSE) +\method{kurtosis}{matrix}(x, na.rm = FALSE, excess = FALSE) -\method{kurtosis}{data.frame}(x, na.rm = FALSE) +\method{kurtosis}{data.frame}(x, na.rm = FALSE, excess = FALSE) } \arguments{ \item{x}{a vector of values, a \code{\link{matrix}} or a \link{data.frame}} -\item{na.rm}{a logical value indicating whether \code{NA} values should be stripped before the computation proceeds.} +\item{na.rm}{a logical to indicate whether \code{NA} values should be stripped before the computation proceeds} + +\item{excess}{a logical to indicate whether the \emph{excess kurtosis} should be returned, defined as the kurtosis minus 3.} } \description{ -Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable. +Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable. A normal distribution has a kurtosis of 3 and a excess kurtosis of 0. } -\section{Questioning lifecycle}{ +\section{Stable lifecycle}{ -\if{html}{\figure{lifecycle_questioning.svg}{options: style=margin-bottom:5px} \cr} -The \link[=lifecycle]{lifecycle} of this function is \strong{questioning}. This function might be no longer be optimal approach, or is it questionable whether this function should be in this \code{AMR} package at all. +\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} +The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. + +If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/man/mdro.Rd b/man/mdro.Rd index 1d2500af..a2988590 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -94,10 +94,12 @@ Please suggest your own (country-specific) guidelines by letting us know: \url{h \strong{Note:} Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named \emph{order} Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu \emph{et al.} in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this \code{\link[=mdro]{mdro()}} function makes sure that results from before 2016 and after 2016 are identical. } -\section{Maturing lifecycle}{ +\section{Stable lifecycle}{ -\if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr} -The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome \href{https://github.com/msberends/AMR/issues}{to suggest changes at our repository} or \link[=AMR]{write us an email (see section 'Contact Us')}. +\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} +The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. + +If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Antibiotics}{ diff --git a/man/skewness.Rd b/man/skewness.Rd index 08c0b077..b4d2a6f8 100644 --- a/man/skewness.Rd +++ b/man/skewness.Rd @@ -18,17 +18,19 @@ skewness(x, na.rm = FALSE) \arguments{ \item{x}{a vector of values, a \code{\link{matrix}} or a \link{data.frame}} -\item{na.rm}{a logical value indicating whether \code{NA} values should be stripped before the computation proceeds.} +\item{na.rm}{a logical value indicating whether \code{NA} values should be stripped before the computation proceeds} } \description{ Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. -When negative: the left tail is longer; the mass of the distribution is concentrated on the right of the figure. When positive: the right tail is longer; the mass of the distribution is concentrated on the left of the figure. +When negative ('left-skewed'): the left tail is longer; the mass of the distribution is concentrated on the right of a histogram. When positive ('right-skewed'): the right tail is longer; the mass of the distribution is concentrated on the left of a histogram. A normal distribution has a skewness of 0. } -\section{Questioning lifecycle}{ +\section{Stable lifecycle}{ -\if{html}{\figure{lifecycle_questioning.svg}{options: style=margin-bottom:5px} \cr} -The \link[=lifecycle]{lifecycle} of this function is \strong{questioning}. This function might be no longer be optimal approach, or is it questionable whether this function should be in this \code{AMR} package at all. +\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr} +The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided. + +If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error. } \section{Read more on our website!}{ diff --git a/tests/testthat/test-kurtosis.R b/tests/testthat/test-kurtosis.R index ebf824ca..ca12b3e2 100644 --- a/tests/testthat/test-kurtosis.R +++ b/tests/testthat/test-kurtosis.R @@ -26,10 +26,18 @@ test_that("kurtosis works", { expect_equal(kurtosis(example_isolates$age), 3.549319, tolerance = 0.00001) + expect_equal(unname(kurtosis(data.frame(example_isolates$age))), 3.549319, tolerance = 0.00001) + expect_equal(unname(kurtosis(data.frame(example_isolates$age), excess = TRUE)), + 0.549319, + tolerance = 0.00001) + expect_equal(kurtosis(matrix(example_isolates$age)), 3.549319, tolerance = 0.00001) + expect_equal(kurtosis(matrix(example_isolates$age), excess = TRUE), + 0.549319, + tolerance = 0.00001) })