- Home
- CRAN
**NCmisc**: Miscellaneous Functions for Creating Adaptive Functions and Scripts**out.of**: Easily display fraction and percentages

# Easily display fraction and percentages

### Description

For a subset 'n' and total 'N', nicely prints text n/N and/or percentage Often we want to display proportions and this simple function reduces the required amount of code for fraction and percentage reporting. If insufficient digits are provided small percentage may truncate to zero.

### Usage

1 |

### Arguments

`n` |
numeric, the count for the subset of N (the numerator) |

`N` |
numeric, the total size of the full set (the denominator) |

`digits,` |
integer, the number of digits to display in the percentage |

`pc,` |
logical, whether to display the percentage of N that n comprises |

`oo,` |
logical, whether to display n/N as a fraction |

`use.sci,` |
logical, whether to allow scientific notation for small/large percentages. |

### Value

A string showing the fraction n/N and percentage (or just one of these)

### Examples

1 2 3 4 |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.

- check.linux.install: Check whether a given system command is installed (e.g, bash)
- check.linux.install: Check whether a given system command is installed (e.g, bash)
- comify: Function to add commas for large numbers
- comify: Function to add commas for large numbers
- cor.with: Simulate a correlated variable
- cor.with: Simulate a correlated variable
- Dim: A more general dimension function
- Dim: A more general dimension function
- dup.pairs: Obtain an index of all instances of values with duplicates...
- dup.pairs: Obtain an index of all instances of values with duplicates...
- estimate.memory: Estimate the memory required for an object.
- estimate.memory: Estimate the memory required for an object.
- exists.not.function: Does object exist ignoring functions
- exists.not.function: Does object exist ignoring functions
- extend.pc: Extend an interval by percentage
- extend.pc: Extend an interval by percentage
- fakeLines: Create fake text for testing purposes
- fakeLines: Create fake text for testing purposes
- file.split: Split a text file into multiple parts
- file.split: Split a text file into multiple parts
- force.percentage: Force argument to be a percentage with length one
- force.percentage: Force argument to be a percentage with length one
- force.scalar: Force argument to be a numeric type with length one
- force.scalar: Force argument to be a numeric type with length one
- get.distinct.cols: Return up to 22 distinct colours.
- get.distinct.cols: Return up to 22 distinct colours.
- getRepositories: Detect all available R repositories.
- getRepositories: Detect all available R repositories.
- has.method: Determine whether a function can be applied to an S4...
- has.method: Determine whether a function can be applied to an S4...
- Header: Print heading text with a border.
- Header: Print heading text with a border.
- headl: A good way to preview large lists.
- headl: A good way to preview large lists.
- list.functions.in.file: Show all functions used in an R script file, by package
- list.functions.in.file: Show all functions used in an R script file, by package
- list.to.env: Create variables from a list
- list.to.env: Create variables from a list
- loess.scatter: Draw a scatterplot with a fit line
- loess.scatter: Draw a scatterplot with a fit line
- loop.tracker: Creates a progess bar within a loop
- loop.tracker: Creates a progess bar within a loop
- memory.summary: Summary of RAM footprint for all R objects in the current...
- memory.summary: Summary of RAM footprint for all R objects in the current...
- Mode: Find the mode of a vector.
- Mode: Find the mode of a vector.
- must.use.package: Do everything possible to load an R package.
- must.use.package: Do everything possible to load an R package.
- narm: Return an object with missing values removed.
- narm: Return an object with missing values removed.
- NCmisc-internal: Internal NCmisc Functions
- NCmisc-internal: Internal NCmisc Functions
- NCmisc-package: Miscellaneous Functions for Creating Adaptive Functions and...
- NCmisc-package: Miscellaneous Functions for Creating Adaptive Functions and...
- out.of: Easily display fraction and percentages
- out.of: Easily display fraction and percentages
- packages.loaded: Check whether a set of packages has been loaded
- packages.loaded: Check whether a set of packages has been loaded
- pad.left: Print a vector with appropriate padding so each has equal...
- pad.left: Print a vector with appropriate padding so each has equal...
- pctile: Find data thresholds corresponding to percentiles
- pctile: Find data thresholds corresponding to percentiles
- ppa: Posterior probability of association function
- ppa: Posterior probability of association function
- preview: Output variable states within functions during...
- preview: Output variable states within functions during...
- prv: Output variable states within functions/loops during...
- prv: Output variable states within functions/loops during...
- prv.large: Tidy display function for matrix objects
- prv.large: Tidy display function for matrix objects
- p.to.Z: Convert p-values to Z-scores
- p.to.Z: Convert p-values to Z-scores
- Rfile.index: Create an index file for an R function file
- Rfile.index: Create an index file for an R function file
- rmv.spc: Remove leading and trailing spaces (or other character).
- rmv.spc: Remove leading and trailing spaces (or other character).
- search.cran: Search all CRAN packages for those containing keyword(s).
- search.cran: Search all CRAN packages for those containing keyword(s).
- sim.cor: Simulate a dataset with correlated measures
- sim.cor: Simulate a dataset with correlated measures
- simple.date: Simple representation and retrieval of Date/Time
- simple.date: Simple representation and retrieval of Date/Time
- spc: Print a character a specified number of times.
- spc: Print a character a specified number of times.
- standardize: Convert a numeric vector to Z-scores.
- standardize: Convert a numeric vector to Z-scores.
- Substitute: Convert objects as arguments to object names
- Substitute: Convert objects as arguments to object names
- summarise.r.datasets: Summarise the dimensions and type of available R example...
- textogram: Make an ascii histogram in the console.
- textogram: Make an ascii histogram in the console.
- timeit: Times an expression, with breakdown of time spent in each...
- timeit: Times an expression, with breakdown of time spent in each...
- toheader: Return a string with each first letter of each word in upper...
- toheader: Return a string with each first letter of each word in upper...
- top: Monitor CPU, RAM and Processes
- top: Monitor CPU, RAM and Processes
- Unlist: Unlist a list, starting only from a set depth.
- Unlist: Unlist a list, starting only from a set depth.
- wait: Wait for a period of time.
- wait: Wait for a period of time.
- which.outlier: Return vector indexes of statistical univariate outliers
- which.outlier: Return vector indexes of statistical univariate outliers
- Z.to.p: Convert Z-scores to p-values
- Z.to.p: Convert Z-scores to p-values