Skip to content

Commit

Permalink
fix empty documentation of some arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bgctw committed Jan 24, 2024
1 parent 527a5cf commit b63f2d3
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 50 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ vignettes/*.pdf
/.svn
.Rproj.user
*.Rproj
# twutz 2401
/tmp/
/tests/testthat/Rplots.pdf

2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: logitnorm
Title: Functions for the Logitnormal Distribution
Version: 0.8.38
Version: 0.8.39
Author: Thomas Wutzler
Maintainer: Thomas Wutzler <[email protected]>
Description: Density, distribution, quantile and random generation function for the logitnormal distribution. Estimation of the mode and the first two moments. Estimation of distribution parameters.
Expand Down
21 changes: 12 additions & 9 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# logitnorm 0.8.38
- Reworked twCoefLogitnormMLEFlat
# version 0.8.39
fix empty documentation of some arguments

# version 0.8.38
- Reworked twCoefversionMLEFlat
- Migrated from RUnit to testthat

# logitnorm 0.8.37
# version 0.8.37

- Density returns 0 instead of NAN outside (0,1)
- Changed first argument name of dlogitnorm from q to x
- Document argument n of rlogitnorm
- Changed first argument name of dversion from q to x
- Document argument n of rversion

# logitnorm 0.8.36
# version 0.8.36
Remove the library call to MASS.

# logitnorm 0.8.35
# version 0.8.35
Avoid writing file reports during testing and installation.

# logitnorm 0.8.33
# version 0.8.33

## New features

### density on log-scale

Thanks to @madeleine-empirical the density function `dlogitnorm` now has `log` an argument that allows computing the density directly at log-scale.
Thanks to @madeleine-empirical the density function `dversion` now has `log` an argument that allows computing the density directly at log-scale.


## Further changes
Expand Down
22 changes: 13 additions & 9 deletions R/logitnorm.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

logit <- function(
### Transforming (0,1) to normal scale (-Inf Inf)
p,...
p ##<< percentile
,... ##<< further arguments to qlogis
){
##details<<
## function \eqn{logit(p) = log \left( \frac{p}{1-p} \right) = log(p) - log(1-p)}
Expand All @@ -16,7 +17,8 @@ logit <- function(

invlogit <- function(
### Transforming (-Inf,Inf) to original scale (0,1)
q,...
q, ##<< quantile
... ##<< further arguments to plogis
){
##details<<
## function \eqn{f(z) = \frac{e^{z}}{e^{z} + 1} \! = \frac{1}{1 + e^{-z}} \!}
Expand All @@ -42,8 +44,9 @@ rlogitnorm <- function(
plogitnorm <- function(
### Distribution function for logitnormal distribution
q ##<< vector of quantiles
, mu = 0, sigma = 1 ##<< distribution parameters
, ...
, mu = 0 ##<< location distribution parameter
, sigma = 1 ##<< scale distribution parameter
, ... ##<< further arguments to pnorm
){
##seealso<< \code{\link{logitnorm}}
ql <- qlogis(q)
Expand All @@ -54,7 +57,8 @@ plogitnorm <- function(
dlogitnorm <- function(
### Density function of logitnormal distribution
x ##<< vector of quantiles
, mu = 0, sigma = 1 ##<< distribution parameters
, mu = 0 ##<< scale distribution parameter
, sigma = 1 ##<< location distribution parameter
, log = FALSE ##<< if TRUE, the log-density is returned
, ... ##<< further arguments passed to \code{\link{dnorm}}: \code{mean},
## and \code{sd} for mu and sigma respectively.
Expand Down Expand Up @@ -89,8 +93,9 @@ dlogitnorm <- function(
qlogitnorm <- function(
### Quantiles of logitnormal distribution.
p ##<< vector of probabilities
, mu = 0, sigma = 1 ##<< distribution parameters
, ...
, mu = 0 ##<< location distribution parameter
, sigma = 1 ##<< scale distribution parameter
, ... ##<< further arguments to plogis
){
##seealso<< \code{\link{logitnorm}}
qn <- qnorm(p,mean = mu,sd = sigma,...)
Expand Down Expand Up @@ -166,7 +171,6 @@ twCoefLogitnorm <- function(
median ##<< numeric vector: the median of the density function
, quant ##<< numeric vector: the upper quantile value
, perc = 0.975 ##<< numeric vector: the probability for which the quantile was specified
, ...
){
##seealso<< \code{\link{logitnorm}}
# twCoefLogitnorm
Expand Down Expand Up @@ -397,7 +401,7 @@ twCoefLogitnormE <- function(
, theta0 = c(mu = 0,sigma = 1) ##<< starting parameters
, returnDetails = FALSE ##<< if TRUE, the full output of optim is returned
## with attribute resOptim
, ...
, ... ##<< further arguments to optim
){
##seealso<< \code{\link{logitnorm}}
# twCoefLogitnormE
Expand Down
6 changes: 2 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
## Note
Added random seeds to tests to avoid accidental failing,
and markdown dependency to Suggests.
Fixed empty Rd comments for some arguments.

## Test environments
* local R 4.0.3 on Mint 20 64bit
* local R 4.3.2 on Mint 21.2 64bit
* r-hub.io
* winbuilder

## R CMD check results
There were no ERRORs nor WARNINGs nor NOTEs
Expand Down
36 changes: 36 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Logitnormal
README
RUnit
Rmd
dlogitnorm
dversion
github
invlogit
logitnormal
md
mle
modeLogitnorm
momentsLogitnorm
optim
perc
plogis
plogitnorm
pnorm
precisions
qlogis
qlogitnorm
quant
resOptim
rlogitnorm
rversion
sigmaFac
testthat
twCoefLogitnorm
twCoefLogitnormCi
twCoefLogitnormE
twCoefLogitnormMLE
twCoefLogitnormMLEFlat
twCoefLogitnormN
twCoefversionMLEFlat
twSigmaLogitnorm
vectorized
5 changes: 2 additions & 3 deletions man/dlogitnorm.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
...)}
\arguments{
\item{x}{vector of quantiles}
\item{mu}{distribution parameters}
\item{sigma}{
}
\item{mu}{scale distribution parameter}
\item{sigma}{location distribution parameter}
\item{log}{if TRUE, the log-density is returned}
\item{\dots}{further arguments passed to \code{\link{dnorm}}: \code{mean},
and \code{sd} for mu and sigma respectively. }
Expand Down
6 changes: 2 additions & 4 deletions man/invlogit.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
\description{Transforming (-Inf,Inf) to original scale (0,1)}
\usage{invlogit(q, ...)}
\arguments{
\item{q}{
}
\item{\dots}{
}
\item{q}{quantile}
\item{\dots}{further arguments to plogis}
}
\details{function \eqn{f(z) = \frac{e^{z}}{e^{z} + 1} \! = \frac{1}{1 + e^{-z}} \!}}

Expand Down
6 changes: 2 additions & 4 deletions man/logit.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
\description{Transforming (0,1) to normal scale (-Inf Inf)}
\usage{logit(p, ...)}
\arguments{
\item{p}{
}
\item{\dots}{
}
\item{p}{percentile}
\item{\dots}{further arguments to qlogis}
}
\details{function \eqn{logit(p) = log \left( \frac{p}{1-p} \right) = log(p) - log(1-p)}}

Expand Down
8 changes: 3 additions & 5 deletions man/plogitnorm.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
\usage{plogitnorm(q, mu = 0, sigma = 1, ...)}
\arguments{
\item{q}{vector of quantiles}
\item{mu}{distribution parameters}
\item{sigma}{
}
\item{\dots}{
}
\item{mu}{location distribution parameter}
\item{sigma}{scale distribution parameter}
\item{\dots}{further arguments to pnorm}
}


Expand Down
8 changes: 3 additions & 5 deletions man/qlogitnorm.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
\usage{qlogitnorm(p, mu = 0, sigma = 1, ...)}
\arguments{
\item{p}{vector of probabilities}
\item{mu}{distribution parameters}
\item{sigma}{
}
\item{\dots}{
}
\item{mu}{location distribution parameter}
\item{sigma}{scale distribution parameter}
\item{\dots}{further arguments to plogis}
}


Expand Down
5 changes: 1 addition & 4 deletions man/twCoefLogitnorm.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
\alias{twCoefLogitnorm}
\title{twCoefLogitnorm}
\description{Estimating coefficients of logitnormal distribution from median and upper quantile }
\usage{twCoefLogitnorm(median, quant, perc = 0.975,
...)}
\usage{twCoefLogitnorm(median, quant, perc = 0.975)}
\arguments{
\item{median}{numeric vector: the median of the density function}
\item{quant}{numeric vector: the upper quantile value}
\item{perc}{numeric vector: the probability for which the quantile was specified}
\item{\dots}{
}
}

\value{numeric matrix with columns \code{c("mu","sigma")}
Expand Down
3 changes: 1 addition & 2 deletions man/twCoefLogitnormE.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ specified}
\item{theta0}{starting parameters}
\item{returnDetails}{if TRUE, the full output of optim is returned
with attribute resOptim}
\item{\dots}{
}
\item{\dots}{further arguments to optim}
}

\value{named numeric matrix with estimated parameters of the logitnormal
Expand Down

0 comments on commit b63f2d3

Please sign in to comment.