File: show-functions.R

package info (click to toggle)
r-cran-maldiquant 1.18-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,860 kB
  • sloc: ansic: 315; sh: 10; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 355 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## .prepareShowGroupName
##  prepares a group name for show (appends numbers to name if needed)
##
## params:
##  x: vector
##  name: group name
##
## returns:
##
.prepareShowGroupName <- function(x, name) {
  if (!is.null(x)) {
    n <- length(x)

    if (n > 1L) {
      name <- paste0(name, seq_len(n))
    }

  } else {
    name <- NULL
  }

  name
}