validNames: Create valid names

Description Usage Arguments Value See Also Examples

View source: R/names.R

Description

Create a set of valid names (trimmed, no duplicates, not starting with a number).

Usage

1
validNames(x, prefix='layer')

Arguments

x

character

prefix

character string used if x is empty

Value

character

See Also

make.names

Examples

1
validNames(c('a', 'a', '', '1', NA, 'b', 'a'))

Example output

Loading required package: sp
[1] "a.1"     "a.2"     "layer.1" "X1"      "layer.2" "b"       "a.3"    

raster documentation built on Jan. 5, 2021, 3:01 a.m.