Improved documentation
This commit is contained in:
parent
06eb8e5433
commit
47eb3f4e90
6 changed files with 15 additions and 14 deletions
1
R/rand.R
1
R/rand.R
|
|
@ -4,6 +4,7 @@
|
||||||
#' @param c number of columns of output matrix
|
#' @param c number of columns of output matrix
|
||||||
#' @return \eqn{r \times c} matrix with random trials from a standard uniform distribution.
|
#' @return \eqn{r \times c} matrix with random trials from a standard uniform distribution.
|
||||||
#' @importFrom stats runif
|
#' @importFrom stats runif
|
||||||
|
#' @export
|
||||||
rand <- function(r = 1, c = 1) {
|
rand <- function(r = 1, c = 1) {
|
||||||
matrix(runif(r * c), r, c)
|
matrix(runif(r * c), r, c)
|
||||||
}
|
}
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#' @details This function was created to replicate the behavior of a homonymous
|
#' @details This function was created to replicate the behavior of a homonymous
|
||||||
#' function on Matlab
|
#' function on Matlab
|
||||||
#' @param mx matrix
|
#' @param mx matrix
|
||||||
#' @param n either a scalat with the number of replications in both rows and columns or a 2-length vector with individual repetitions.
|
#' @param n either a scalar with the number of replications in both rows and columns or a 2-length vector with individual repetitions.
|
||||||
#' @return matrix replicated over `ncol(mx) * n` columns and `nrow(mx) * n` rows
|
#' @return matrix replicated over `ncol(mx) * n` columns and `nrow(mx) * n` rows
|
||||||
#' @note The Matlab implementation of this function accepts `n` with length > 2.
|
#' @note The Matlab implementation of this function accepts `n` with length > 2.
|
||||||
#' @export
|
#' @export
|
||||||
|
|
|
||||||
12
TODO.md
12
TODO.md
|
|
@ -25,12 +25,12 @@ The list below contains non-essential but nice-to-have tasks for the next stable
|
||||||
|
|
||||||
The following behavioral differences have been detected between the Matlab functions and their R counterparts. In order to save time, these differences will not be addressed, since they could require extensive reworking of a function. However, such differences may very well cause unexpected problems in some situations, which is why compiling this list is so important. The list below might provide a good starting point for identifying and fixing bugs:
|
The following behavioral differences have been detected between the Matlab functions and their R counterparts. In order to save time, these differences will not be addressed, since they could require extensive reworking of a function. However, such differences may very well cause unexpected problems in some situations, which is why compiling this list is so important. The list below might provide a good starting point for identifying and fixing bugs:
|
||||||
|
|
||||||
Function | Argument | Value | Matlab output | R output
|
| Function | Argument | Value | Matlab output | R output |
|
||||||
---------|----------|-------|---------------|---------
|
| ----------------- | ------------------ | -------------- | --------------------- | ------------------------------- |
|
||||||
`ownNum2Str` | `number` | `NaN` | `'NAN'` | error
|
| `ownNum2Str` | `number` | `NaN` | `'NAN'` | error |
|
||||||
`ownNum2Str` | `number` | `<vector>` | `'<vector elements>'` | `'<vector elements>'` + warning
|
| `ownNum2Str` | `number` | `<vector>` | `'<vector elements>'` | `'<vector elements>'` + warning |
|
||||||
`repmat` | `length(n)` | `> 2` | > 2D matrix | 2D matrix
|
| `repmat` | `length(n)` | `> 2` | > 2D matrix | 2D matrix |
|
||||||
`computeIndLogml` | only one of the arguments is negative | complex number | `NaN`
|
| `computeIndLogml` | some arguments < 0 | complex number | `NaN` |
|
||||||
|
|
||||||
As general remarks, one should keep in mind that:
|
As general remarks, one should keep in mind that:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
computeIndLogml(omaFreqs, osuusTaulu)
|
computeIndLogml(omaFreqs, osuusTaulu)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{omaFreqs}{omaFreqs}
|
\item{omaFreqs}{own Freqs?}
|
||||||
|
|
||||||
\item{osuusTaulu}{osuusTaulu}
|
\item{osuusTaulu}{Percentage table?}
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Palauttaa yksilön logml:n, kun oletetaan yksilön alkuperät
|
Palauttaa yksilön logml:n, kun oletetaan yksilön alkuperät
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,13 @@
|
||||||
laskeMuutokset4(osuus, osuusTaulu, omaFreqs, logml, COUNTS = matrix(0))
|
laskeMuutokset4(osuus, osuusTaulu, omaFreqs, logml, COUNTS = matrix(0))
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{osuus}{osuus}
|
\item{osuus}{Percentages?}
|
||||||
|
|
||||||
\item{osuusTaulu}{osuusTaulu}
|
\item{osuusTaulu}{Percentage table?}
|
||||||
|
|
||||||
\item{omaFreqs}{omaFreqs}
|
\item{omaFreqs}{own Freqs?}
|
||||||
|
|
||||||
\item{logml}{logml}
|
\item{logml}{log maximum likelihood}
|
||||||
|
|
||||||
\item{COUNTS}{COUNTS}
|
\item{COUNTS}{COUNTS}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ repmat(mx, n)
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{mx}{matrix}
|
\item{mx}{matrix}
|
||||||
|
|
||||||
\item{n}{either a scalat with the number of replications in both rows and columns or a 2-length vector with individual repetitions.}
|
\item{n}{either a scalar with the number of replications in both rows and columns or a 2-length vector with individual repetitions.}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
matrix replicated over `ncol(mx) * n` columns and `nrow(mx) * n` rows
|
matrix replicated over `ncol(mx) * n` columns and `nrow(mx) * n` rows
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue