-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81b7448
commit 01f548d
Showing
14 changed files
with
217 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
\name{EX} | ||
\alias{EX} | ||
\alias{VarX} | ||
%- Also NEED an '\alias' for EACH other topic documented here. | ||
\title{Expected Value and Variance | ||
%% ~~function to do ... ~~ | ||
} | ||
\description{Expected Value and Variance for the distribution of a discrete random variable. | ||
(For didactical purposes..) | ||
%% ~~ A concise (1-5 lines) description of what the function does. ~~ | ||
} | ||
\usage{ | ||
EX(x, p) | ||
VarX(x, p) | ||
} | ||
%- maybe also 'usage' for other objects documented here. | ||
\arguments{ | ||
\item{x}{the values of the random variable | ||
%% ~~Describe \code{x} here~~ | ||
} | ||
\item{p}{the probabilities of the values | ||
%% ~~Describe \code{p} here~~ | ||
} | ||
} | ||
\value{numeric value | ||
} | ||
\author{Andri Signorell <andri@signorell.net> | ||
%% ~~who you are~~ | ||
} | ||
\examples{ | ||
EX(x=c(1:3), p=c(0.2, 0.5, 0.3)) | ||
VarX(x=c(1:3), p=c(0.2, 0.5, 0.3)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
\name{Mgsub} | ||
\alias{Mgsub} | ||
%- Also NEED an '\alias' for EACH other topic documented here. | ||
\title{Multiple Gsub | ||
%% ~~function to do ... ~~ | ||
} | ||
\description{Performs multiple substitions in (a) string(s). | ||
%% ~~ A concise (1-5 lines) description of what the function does. ~~ | ||
} | ||
\usage{ | ||
Mgsub(pattern, replacement, x, ...) | ||
} | ||
%- maybe also 'usage' for other objects documented here. | ||
\arguments{ | ||
\item{pattern}{character string containing a regular expression (or character string for fixed = TRUE) to be matched in the given character vector. Coerced by as.character to a character string if possible. | ||
} | ||
\item{replacement}{a replacement for matched pattern as in \code{\link{sub}} and \code{\link{gsub}}. | ||
See there for more information. | ||
} | ||
\item{x}{a character vector where matches are sought, or an object which can be coerced by as.character to a character vector. Long vectors are supported. | ||
} | ||
\item{\dots}{all dots are passed on to gsub. | ||
} | ||
} | ||
\value{ | ||
a character vector of the same length and with the same attributes as x (after possible coercion to character). | ||
} | ||
\author{Andri Signorell <andri@signorell.net> | ||
} | ||
\seealso{\code{\link{gsub}} | ||
} | ||
\examples{ | ||
x <- c("ABC", "BCD", "CDE") | ||
Mgsub(pattern=c("B", "C"), replacement=c("X","Y"), x) | ||
} |
Oops, something went wrong.