cat_apply_freq {cat2cat}R Documentation

Applying frequencies to object returned by get_mappings

Description

applying frequencies to object returned by get_mappings

Usage

cat_apply_freq(to_x, freqs)

Arguments

to_x

list object returned by get_mappings

freqs

vector object returned by get_freqs

Value

list

Examples

data(trans)
data(occup)

mappings <- get_mappings(trans)

mappings$to_old[1:4]
mappings$to_new[1:4]

mapp_p <- cat_apply_freq(
  mappings$to_old,
  get_freqs(
    occup$code[occup$year == "2008"],
    occup$multiplier[occup$year == "2008"]
  )
)
head(data.frame(I(mappings$to_old), I(mapp_p)))
mapp_p <- cat_apply_freq(
  mappings$to_new,
  get_freqs(
    occup$code[occup$year == "2010"],
    occup$multiplier[occup$year == "2010"]
  )
)
head(data.frame(I(mappings$to_new), I(mapp_p)))

[Package cat2cat version 0.2.1 Index]