Description Usage Arguments Value Author(s) References Examples
View source: R/ff_summ_count.R
We have multiple groups (country, village), we want to know the number of unique observations within these groups. In addition, we also want to generate the total number of observations for each variable within these country/village groups, these total observations includes multiple values for each unique individual.
1 2 3 4 5 | ff_summ_count_unique_by_groups(
df,
ar_svr_group = c("S.country", "vil.id"),
svr_unique_identifier = "indi.id"
)
|
df |
dataframe input dataframe of interest |
ar_svr_group |
array string array of variables to group by |
svr_unique_identifier |
string variable that has the unique key of interest |
a dataframe with stats outputs.
Fan Wang, http://fanwangecon.github.io
https://fanwangecon.github.io/REconTools/reference/ff_summ_count_unique_by_groups.html https://github.com/FanWangEcon/REconTools/blob/master/R/ff_summ_count.R
1 2 3 4 5 6 7 8 9 10 11 12 | df_uniques_count_by_vil <- ff_summ_count_unique_by_groups(df_hgt_wgt,
ar_svr_group=c('S.country', 'vil.id'),
svr_unique_identifier = 'indi.id')
print(df_uniques_count_by_vil, n=50)
df_uniques_count_by_mth <- ff_summ_count_unique_by_groups(df_hgt_wgt,
ar_svr_group=c('S.country', 'svymthRound'),
svr_unique_identifier = 'indi.id')
print(df_uniques_count_by_mth, n=50)
df_uniques_count_by_country <- ff_summ_count_unique_by_groups(df_hgt_wgt,
ar_svr_group=c('S.country'),
svr_unique_identifier = 'indi.id')
print(df_uniques_count_by_country)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.