Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################### TestFunction #############################################
- library(tidyr)
- library(imputeSample)
- splitISample <- function(myData, filter, weight_aggregate, weight_col,iterasi, sample_flag = 1){
- weight_agg <- weight_aggregate
- filter = filter
- splitDataFrame <- myData %>% nest(-KODE_PROV, -KODE_KAB)
- temp <- list()
- for (i in dim(splitDataFrame)[1]) {
- temp[[i]] <- imputation_sample(as.data.frame(splitDataFrame$data[[i]]), filters = my_filter, weight_aggregate = weight_aggregate, weight_col = Weight_R, iter = 50)
- }
- outputData = data.frame()
- for (i in 1:length(temp)) {
- outputData <- rbind(outputData, temp[[i]])
- }
- return(outputData)
- }
Add Comment
Please, Sign In to add comment