tests/globalRecoding_test.R

# require(sdcMicro)
# data(testdata)
# sdc <- createSdcObj(testdata, keyVars = c("urbrur", "water", "sex", "age"),
#   numVars = c("expend", "income", "savings"), w = "sampling_weight", hhId = "ori_hid")
# 
# print(sdc)
# sdc2 <- globalRecode(sdc, column = "age", breaks = c(1, 9, 19, 29, 39, 49, 59, 69, 100), labels = 1:8)
# print(sdc2)
# 
# f1 <- get.sdcMicroObj(sdc, "risk")$individual[, "fk"]
# f2 <- get.sdcMicroObj(sdc2, "risk")$individual[, "fk"]
# if (identical(f1, f2)) stop("frequency counts are not updated")

Try the sdcMicro package in your browser

Any scripts or data that you put into this service are public.

sdcMicro documentation built on Sept. 27, 2023, 5:07 p.m.