credo.companycode: Recodes Mutual Fund Company Names in Canada from Verbatim...

Description Usage Arguments Value References Examples

Description

This function takes a character vector or factor, and recodes misspelled words into the corrected company names. Uses pre-programmed find and replace.

Usage

1
2
credo.companycode(verbatim, hold.na = FALSE, other = FALSE,
  year = format(Sys.Date(), format = "%Y"))

Arguments

verbatim

A character vector or factor to be recoded

hold.na

Logical, maintain NA values to keep ordering

other

convert unmatched to "Other" or leave as is

year

full year to extract from credobb3 companies list

Value

m A list containing recoded factors ($verbatims) and unmatched values ($unmatched)

References

Trim functionality courtesy of f3lix: http://stackoverflow.com/a/2261149/170352

Examples

1
2
3
4
verbatim <- c("CI","bmo","cibc","renaisance","vpi",NA,"Aim","why")
credo.companycode(verbatim)
credo.companycode(verbatim, TRUE)
credo.companycode(verbatim, TRUE, FALSE)

credoinc/credoc documentation built on May 23, 2019, 8:39 a.m.