Skip to content

Commit

Permalink
new function master !
Browse files Browse the repository at this point in the history
  • Loading branch information
nmouquet committed May 3, 2023
1 parent b8084a2 commit d202d16
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export(leading_zero)
export(len)
export(multi_merge)
export(rename_col)
export(signi)
export(to_binomial_name)
19 changes: 19 additions & 0 deletions R/signi.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#' Produce produces significance symbols for the values of p (ns., *, **, ***)
#'
#' @param p a p value
#'
#' @return a character "ns", "*", "**", "***"
#'
#' @export
#'
#' @examples
#' signi(p=0.004)
#'

signi <- function(p){
if (p>0.05) symbol="ns."
if ((p<=0.05) & (p>0.01)) symbol="*"
if ((p<=0.01) & (p>0.001)) symbol="**"
if (p<=0.001) symbol="***"
return(symbol)
}
2 changes: 2 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ library("rutils")

- [`rename_col()`](https://frbcesab.github.io/rutils/reference/rename_col.html): Rename any columns of a dataframe (from 1 to as much columns as you want)

- [`rename_col()`](https://frbcesab.github.io/rutils/reference/signi.html): Produce produces significance symbols for the values of p


## Contribution

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ library("rutils")
Rename any columns of a dataframe (from 1 to as much columns as you
want)

- [`rename_col()`](https://frbcesab.github.io/rutils/reference/signi.html):
Produce produces significance symbols for the values of p

## Contribution

Visit the
Expand Down
21 changes: 21 additions & 0 deletions man/signi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d202d16

Please sign in to comment.