Tools for Working with Names

A system for organizing column names in data. Aimed at supporting a prefix-based and suffix-based column naming scheme. Extends 'dplyr' functionality to add ordering by function and more explicit renaming.


name

R-CMD-check name statusbadge Lifecycle:stable CRANstatus CRAN downloads

Organizes functions for consistent column naming for tibbles and data.frames.

Installation

You can install the released version of name from CRAN with:

install.packages('name')

You can install the current version of name from GitHub.

pak::pak('christopherkenny/name')

Example

library(name)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
data(mtcars)

We can add a prefix:

mtcars <- mtcars %>% 
  rename_with(\(x) add_pref(x, 'pref_'))

And similarly a suffix:

mtcars <- mtcars %>% 
  rename_with(\(x) add_suff(x, '_suff'))

Or a replace a phrase:

mtcars <- mtcars %>% 
  rename_with(\(x) repl_phrase(x, '_hp', '_hitpoints'))

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("name")

0.0.2 by Christopher T. Kenny, a year ago


https://github.com/christopherkenny/name, https://christophertkenny.com/name/


Report a bug at https://github.com/christopherkenny/name/issues


Browse source code at https://github.com/cran/name


Authors: Christopher T. Kenny [aut, cre] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports tibble, dplyr, stringr, tidyselect, rlang, cli

Suggests testthat


See at CRAN