Function to recode CMAM coverage indicators
recode_cmam( df, core.columns = c("spid", "cid", "did", "eid", "motherID", "m2") )
df | A coverage data.frame collected for the Liberia Coverage Survey |
---|---|
core.columns | A vector of variable names to include in resulting data.frame |
A data.frame of recoded CMAM coverage indicators
recode_cmam(df = coverageData.r2)#> ================================================================================ #> ================================================================================ #> ================================================================================#> cid spid cin cout rin q1 q1a q1b q1c q1d q1e q1f q2 q3 q4a q4b q4c q4d q4e #> 1 1 1 1 3 0 0 1 0 0 0 0 2 0 1 0 0 0 0 0 #> 2 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 3 1 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 4 1 4 0 3 1 0 1 1 0 0 0 1 0 3 0 0 0 0 0 #> 5 1 5 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 6 1 6 0 5 3 1 2 0 0 1 1 2 0 0 0 1 0 0 0 #> 7 1 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 8 1 8 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 #> 9 1 9 0 3 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 #> 10 1 10 0 1 3 1 0 0 0 0 0 0 0 1 0 0 0 0 0 #> 11 1 11 0 1 2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 #> 12 1 12 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 #> 13 1 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 14 1 14 1 2 3 1 1 0 0 0 0 0 1 1 0 0 0 0 0 #> 15 1 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> 16 1 16 1 2 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 #> 17 1 17 0 3 0 0 0 1 2 3 0 0 1 2 0 0 1 0 0 #> 18 1 18 3 1 4 1 0 0 0 0 0 0 1 0 0 0 0 0 0 #> 19 1 19 0 4 0 0 3 2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 0 0 0 0 0 1 0 0.0000000 0.2307692 #> 7 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN #> 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 9 0 0 0 1 0 0 0 0 0 0 0 0 0 0.0000000 0.2000000 #> 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.6000000 #> 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.6666667 #> 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 13 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN #> 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3333333 0.5714286 #> 15 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN #> 16 0 0 0 0 0 0 0 0 1 0 0 1 0 0.3333333 0.3333333 #> 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 18 0 0 0 0 0 0 0 1 0 0 0 0 0 0.7500000 0.8750000 #> 19 0 0 0 0 0 0 0 0 0 0 1 1 0 0.0000000 0.0000000 #> 20 0 0 0 0 0 0 0 0 0 0 0 0 0 1.0000000 1.0000000 #> 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 22 0 0 0 1 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 23 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 24 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN 1.0000000 #> 25 0 0 0 0 0 0 0 0 0 0 1 0 0 0.0000000 0.5000000 #> 26 0 1 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.6666667 #> 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 28 0 0 0 0 0 0 0 0 0 0 0 1 0 0.0000000 0.0000000 #> 29 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN 1.0000000 #> 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 33 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3333333 0.3333333 #> 34 0 0 0 0 0 0 0 0 0 0 0 1 0 0.0000000 0.0000000 #> 35 0 0 0 0 0 0 0 0 0 0 0 0 0 1.0000000 1.0000000 #> 36 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN #> 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 38 0 0 0 1 0 0 1 0 0 0 0 0 0 0.0000000 0.0000000 #> 39 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 40 0 0 1 1 0 1 0 0 0 0 0 1 0 0.0000000 0.2307692 #> 41 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 42 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN #> 43 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.5000000 #> 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 45 0 0 0 0 0 0 0 0 0 0 1 0 0 0.0000000 0.5000000 #> 46 1 1 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 47 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 48 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.0000000 #> 49 0 0 0 0 0 0 0 1 0 0 0 0 0 0.0000000 0.0000000 #> 50 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN #> 51 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN 1.0000000 #> 52 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN #> 53 0 0 1 0 0 0 0 0 0 0 1 1 0 0.0000000 0.5000000 #> 54 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN 1.0000000 #> 55 0 0 0 0 0 0 0 0 0 0 0 1 0 0.3333333 0.3333333 #> 56 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN #> 57 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0000000 0.1666667 #> 58 0 0 0 0 0 0 0 0 0 0 0 1 0 0.0000000 0.0000000 #> 59 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN #> 60 0 0 0 0 0 0 0 0 0 0 0 0 0 NaN NaN