Last data update: 2014.03.03

R: Recodes the values of a character vector
recoderR Documentation

Recodes the values of a character vector

Description

Recodes the values of a character vector

Usage

recoder(x, from = c(), to = c())

Arguments

x

character vector

from

character vector with old values

to

character vector with new values

Value

x where from values are recoded to the supplied to values

See Also

match

Examples

recoder(x=append(LETTERS, NA, 5), from = c("A","B"), to = c("a.123","b.123"))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ETLUtils)
Loading required package: ff
Loading required package: bit
Attaching package bit
package:bit (c) 2008-2012 Jens Oehlschlaegel (GPL-2)
creators: bit bitwhich
coercion: as.logical as.integer as.bit as.bitwhich which
operator: ! & | xor != ==
querying: print length any all min max range sum summary
bit access: length<- [ [<- [[ [[<-
for more help type ?bit

Attaching package: 'bit'

The following object is masked from 'package:base':

    xor

Attaching package ff
- getOption("fftempdir")=="/tmp/RtmpmEEt7U"

- getOption("ffextension")=="ff"

- getOption("ffdrop")==TRUE

- getOption("fffinonexit")==TRUE

- getOption("ffpagesize")==65536

- getOption("ffcaching")=="mmnoflush"  -- consider "ffeachflush" if your system stalls on large writes

- getOption("ffbatchbytes")==16777216 -- consider a different value for tuning your system

- getOption("ffmaxbytes")==536870912 -- consider a different value for tuning your system


Attaching package: 'ff'

The following objects are masked from 'package:bit':

    clone, clone.default, clone.list

The following objects are masked from 'package:utils':

    write.csv, write.csv2

The following objects are masked from 'package:base':

    is.factor, is.ordered

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ETLUtils/recoder.Rd_%03d_medium.png", width=480, height=480)
> ### Name: recoder
> ### Title: Recodes the values of a character vector
> ### Aliases: recoder
> 
> ### ** Examples
> 
> recoder(x=append(LETTERS, NA, 5), from = c("A","B"), to = c("a.123","b.123"))
 [1] "a.123" "b.123" "C"     "D"     "E"     NA      "F"     "G"     "H"    
[10] "I"     "J"     "K"     "L"     "M"     "N"     "O"     "P"     "Q"    
[19] "R"     "S"     "T"     "U"     "V"     "W"     "X"     "Y"     "Z"    
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>