-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from philsf/release-0.4.0
Release 0.4.0
- Loading branch information
Showing
9 changed files
with
168 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: philsfmisc | ||
Type: Package | ||
Title: philsf's miscellaneous R functions | ||
Version: 0.1.0 | ||
Version: 0.4.0 | ||
Authors@R: person("Felipe", "Figueiredo", email = "[email protected]", role = c("aut", "cre")) | ||
Description: Miscellaneous R functions for convenient data analyses. | ||
License: GPL2 | ||
|
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,4 @@ | ||
cv2logsd <- function(CV) { | ||
SD <- sqrt( cv2logvar(CV) ) | ||
SD | ||
} |
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,4 @@ | ||
cv2logvar <- function( CV ) { | ||
VAR <- (log((CV/100)^2 + 1))/(log(10)^2) | ||
VAR | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
logsd2cv <- function(logsd, digits = 2, na.rm = TRUE) { | ||
round(sqrt(exp(logsd^2) - 1)*100 , digits) | ||
round(sqrt(exp((log(10)^2)*logsd^2) - 1)*100 , digits) | ||
} |
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,3 @@ | ||
logvar2cv <- function(var, digits = 2, na.rm = TRUE) { | ||
round(sqrt(exp((log(10)^2)*var) - 1)*100 , digits) | ||
} |
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,51 @@ | ||
\name{cv2logsd} | ||
\alias{cv2logsd} | ||
%- Also NEED an '\alias' for EACH other topic documented here. | ||
\title{Convert the CV from a log-normal variable to the log-transformed standard deviation. | ||
%% ~~function to do ... ~~ | ||
} | ||
\description{ | ||
%% ~~ A concise (1-5 lines) description of what the function does. ~~ | ||
} | ||
\usage{ | ||
cv2logsd(x) | ||
} | ||
%- maybe also 'usage' for other objects documented here. | ||
\arguments{ | ||
\item{x}{ | ||
%% ~~Describe \code{x} here~~ | ||
} | ||
} | ||
\details{ | ||
%% ~~ If necessary, more details than the description above ~~ | ||
} | ||
\value{ | ||
%% ~Describe the value returned | ||
%% If it is a LIST, use | ||
%% \item{comp1 }{Description of 'comp1'} | ||
%% \item{comp2 }{Description of 'comp2'} | ||
%% ... | ||
} | ||
\references{ | ||
%% ~put references to the literature/web site here ~ | ||
} | ||
\author{ | ||
%% ~~who you are~~ | ||
} | ||
\note{ | ||
%% ~~further notes~~ | ||
} | ||
|
||
%% ~Make other sections like Warning with \section{Warning }{....} ~ | ||
|
||
\seealso{ | ||
%% ~~objects to See Also as \code{\link{help}}, ~~~ | ||
} | ||
\examples{ | ||
cv2logsd(50) | ||
# [1] 0.2051523 | ||
} | ||
% Add one or more standard keywords, see file 'KEYWORDS' in the | ||
% R documentation directory. | ||
\keyword{ ~kwd1 }% use one of RShowDoc("KEYWORDS") | ||
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line |
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,51 @@ | ||
\name{cv2logvar} | ||
\alias{cv2logvar} | ||
%- Also NEED an '\alias' for EACH other topic documented here. | ||
\title{Convert the CV from a log-normal variable to the log-transformed variance. | ||
%% ~~function to do ... ~~ | ||
} | ||
\description{ | ||
%% ~~ A concise (1-5 lines) description of what the function does. ~~ | ||
} | ||
\usage{ | ||
cv2logvar(x) | ||
} | ||
%- maybe also 'usage' for other objects documented here. | ||
\arguments{ | ||
\item{x}{ | ||
%% ~~Describe \code{x} here~~ | ||
} | ||
} | ||
\details{ | ||
%% ~~ If necessary, more details than the description above ~~ | ||
} | ||
\value{ | ||
%% ~Describe the value returned | ||
%% If it is a LIST, use | ||
%% \item{comp1 }{Description of 'comp1'} | ||
%% \item{comp2 }{Description of 'comp2'} | ||
%% ... | ||
} | ||
\references{ | ||
%% ~put references to the literature/web site here ~ | ||
} | ||
\author{ | ||
%% ~~who you are~~ | ||
} | ||
\note{ | ||
%% ~~further notes~~ | ||
} | ||
|
||
%% ~Make other sections like Warning with \section{Warning }{....} ~ | ||
|
||
\seealso{ | ||
%% ~~objects to See Also as \code{\link{help}}, ~~~ | ||
} | ||
\examples{ | ||
cv2logvar(50) | ||
# [1] 0.04208748 | ||
} | ||
% Add one or more standard keywords, see file 'KEYWORDS' in the | ||
% R documentation directory. | ||
\keyword{ ~kwd1 }% use one of RShowDoc("KEYWORDS") | ||
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line |
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,52 @@ | ||
\name{logvar2cv} | ||
\alias{logvar2cv} | ||
%- Also NEED an '\alias' for EACH other topic documented here. | ||
\title{Convert the log-transformed variance from a log-normal variable to the CV. | ||
%% ~~function to do ... ~~ | ||
} | ||
\description{ | ||
%% ~~ A concise (1-5 lines) description of what the function does. ~~ | ||
} | ||
\usage{ | ||
logvar2cv(x) | ||
} | ||
%- maybe also 'usage' for other objects documented here. | ||
\arguments{ | ||
\item{x}{ | ||
%% ~~Describe \code{x} here~~ | ||
} | ||
} | ||
\details{ | ||
%% ~~ If necessary, more details than the description above ~~ | ||
} | ||
\value{ | ||
%% ~Describe the value returned | ||
%% If it is a LIST, use | ||
%% \item{comp1 }{Description of 'comp1'} | ||
%% \item{comp2 }{Description of 'comp2'} | ||
%% ... | ||
} | ||
\references{ | ||
%% ~put references to the literature/web site here ~ | ||
} | ||
\author{ | ||
%% ~~who you are~~ | ||
} | ||
\note{ | ||
%% ~~further notes~~ | ||
} | ||
|
||
%% ~Make other sections like Warning with \section{Warning }{....} ~ | ||
|
||
\seealso{ | ||
%% ~~objects to See Also as \code{\link{help}}, ~~~ | ||
} | ||
\examples{ | ||
d <- c(10,100,1000) | ||
var(log10(d)) # 1 | ||
logvar2cv(1) # 1413.21\% | ||
} | ||
% Add one or more standard keywords, see file 'KEYWORDS' in the | ||
% R documentation directory. | ||
\keyword{ ~kwd1 }% use one of RShowDoc("KEYWORDS") | ||
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line |