tester11235

Untitled

May 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. ################################### TestFunction #############################################
  2.  
  3. library(tidyr)
  4. library(imputeSample)
  5. splitISample <- function(myData, filter, weight_aggregate, weight_col,iterasi, sample_flag = 1){
  6. weight_agg <- weight_aggregate
  7. filter = filter
  8. splitDataFrame <- myData %>% nest(-KODE_PROV, -KODE_KAB)
  9. temp <- list()
  10. for (i in dim(splitDataFrame)[1]) {
  11. temp[[i]] <- imputation_sample(as.data.frame(splitDataFrame$data[[i]]), filters = my_filter, weight_aggregate = weight_aggregate, weight_col = Weight_R, iter = 50)
  12. }
  13. outputData = data.frame()
  14. for (i in 1:length(temp)) {
  15. outputData <- rbind(outputData, temp[[i]])
  16. }
  17. return(outputData)
  18. }
Add Comment
Please, Sign In to add comment