-
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 #34 from philsf/release-0.6.0
Release 0.6.0
- Loading branch information
Showing
18 changed files
with
110 additions
and
30 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.5.1 | ||
Version: 0.6.0 | ||
Authors@R: person("Felipe", "Figueiredo", email = "[email protected]", role = c("aut", "cre")) | ||
Description: Miscellaneous R functions for convenient data analyses. | ||
License: GPL-2 | ||
|
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,4 +1,4 @@ | ||
cv2logsd <- function(CV) { | ||
SD <- sqrt( cv2logvar(CV) ) | ||
cv2logsd <- function(x) { | ||
SD <- sqrt( cv2logvar(x) ) | ||
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cv2logvar <- function( CV ) { | ||
VAR <- (log((CV/100)^2 + 1))/(log(10)^2) | ||
cv2logvar <- function( x ) { | ||
VAR <- (log((x/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,5 +1,5 @@ | ||
format.float <- function(value, digits = 2) { | ||
value <- suppressWarnings(as.numeric(value)) | ||
value <- formatC(value, format = "f", digits = digits) | ||
value | ||
format.float <- function(x, digits = 2) { | ||
x <- suppressWarnings(as.numeric(x)) | ||
x <- formatC(x, format = "f", digits = digits) | ||
x | ||
} |
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,5 @@ | ||
format.pct <- function(p, digits = 1, pct.symbol = TRUE) { | ||
symbol <- "%" | ||
if (!pct.symbol) symbol <- NULL | ||
paste0(format.float(p*100, digits), symbol) | ||
} |
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,4 +1,4 @@ | ||
geocv <- function(datavector, digits = 2, na.rm = TRUE) { | ||
logsd <- sd(log10(datavector), na.rm = na.rm) | ||
logsd2cv(logsd, digits = digits, na.rm = na.rm) | ||
geocv <- function(x, na.rm = TRUE) { | ||
logsd <- sd(log10(x), na.rm = na.rm) | ||
logsd2cv(logsd) | ||
} |
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,4 +1,4 @@ | ||
geomean <- function(datavector) { | ||
datavector[(datavector == 0)] <- NA # discard null values | ||
10^mean(log10(datavector), na.rm = T) | ||
geomean <- function(x) { | ||
x[(x == 0)] <- NA # discard null values | ||
10^mean(log10(x), na.rm = T) | ||
} |
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 @@ | ||
geosd <- function(datavector) { | ||
10^sd(log10(datavector)) | ||
geosd <- function(x) { | ||
10^sd(log10(x)) | ||
} |
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((log(10)^2)*logsd^2) - 1)*100 , digits) | ||
logsd2cv <- function(x) { | ||
sqrt(exp((log(10)^2)*x^2) - 1)*100 | ||
} |
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 @@ | ||
logvar2cv <- function(var, digits = 2, na.rm = TRUE) { | ||
round(sqrt(exp((log(10)^2)*var) - 1)*100 , digits) | ||
logvar2cv <- function(x) { | ||
sqrt(exp((log(10)^2)*x) - 1)*100 | ||
} |
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
Binary file modified
BIN
-297 Bytes
(99%)
inst/rmarkdown/templates/Relatorio/skeleton/misc/style.docx
100644 → 100755
Binary file not shown.
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,51 @@ | ||
\name{format.pct} | ||
\alias{format.pct} | ||
%- Also NEED an '\alias' for EACH other topic documented here. | ||
\title{ | ||
Convenience function to format proportions as percentages | ||
} | ||
\description{ | ||
%% ~~ A concise (1-5 lines) description of what the function does. ~~ | ||
} | ||
\usage{ | ||
format.pct(p, digits = 1, pct.symbol = TRUE) | ||
} | ||
%- maybe also 'usage' for other objects documented here. | ||
\arguments{ | ||
\item{p}{a numeric vector assumed to be a proportion.} | ||
\item{digits}{the number of decimal digits to be used in the output.} | ||
\item{pct.symbol}{(logical) whether or not to include the percent sign in the output.} | ||
} | ||
\details{ | ||
%% ~~ If necessary, more details than the description above ~~ | ||
} | ||
\value{ | ||
A character value formatted as percentages} | ||
\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{ | ||
format.pct(.1) | ||
format.pct(c(.42, .99), 0) | ||
|
||
m <- 10*matrix(c(1, 1.1, .9, 2), nrow = 2) | ||
format.pct(fisher.test(m)$p.value) | ||
format.pct(fisher.test(5*m)$p.value) | ||
format.pct(fisher.test(m)$conf.int) | ||
} | ||
% 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