change.codes {Kmisc}R Documentation

Funcao para troca de codigos

Description

Para um vetor de codigos, substitui os codigos informados no argumento ori por codigos informandos no argumento find.

Usage

change.codes(data, ori, find, els = NA)

Arguments

data ~~Describe data here~~
ori ~~Describe ori here~~
find ~~Describe find here~~
els ~~Describe els here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1 Description of 'comp1'
comp2 Description of 'comp2'

...

Warning

....

Note

~~further notes~~

~Make other sections like Warning with section{Warning }{....} ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--    or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(data, ori, find, els=NA) {
  data[!is.element(data, ori)] <- els
  codes <- cbind(ori, find)
  for (i in 1:nrow(codes))
    data[is.element(data, codes[i, 1])] <- codes[i, 2]
  return(data)
  }

[Package Kmisc version 1.0 Index]