Make syntactically valid names out of character vectors.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
docs
inst/extdata
man
pkgdown
tests
.Rbuildignore
.gitignore
.lintr
.travis.yml
DESCRIPTION
LICENSE
NAMESPACE
NEWS
NEWS.md
README.md
_pkgdown.yml
appveyor.yml
syntactic.Rproj

README.md

syntactic

Travis CI build status AppVeyor CI build status Codecov percent coverage Anaconda cloud version Repo status: active

Make syntactically valid names out of character vectors.

Installation

This package is part of the basejump toolkit. Refer to its website for installation instructions.

Overview

syntactic improves upon the make.names() functionality defined in base R, and is designed to return syntactically valid names from biological metadata. The package exports these primary functions:

  • camel() (e.g. helloWorld).
  • dotted() (e.g. hello.world).
  • snake() (e.g. hello_world).
  • upperCamel() (e.g. HelloWorld).

Additionally, the package exports these utility functions:

  • makeNames(): modified variant of make.names() that sanitizes using underscores instead of dots.
  • capitalize(): Capitalize the first letter of all words in a character vector.

syntactic is designed to handle many common mixed case acronyms (e.g. mRNA, RNAi), as well as decimals in names. Additionally, the package defines S4 method support for a number of popular Bioconductor S4 classes, including DataFrame and GenomicRanges.

Related packages

If syntactic doesn't work quite right for you, these popular packages also provide excellent sanitization support: