Robinlovelace / spatial-microsim-book

Code, data and prose of the book: Spatial Microsimulation with R
https://www.crcpress.com/Spatial-Microsimulation-with-R/Lovelace-Dumont/p/book/9781498711548
MIT License
114 stars 76 forks source link

Problem with int_pp() #143

Open szylkrecik opened 3 years ago

szylkrecik commented 3 years ago

There is a problem with the int_pp function (PP integerisation) due to the limitation of summary() by maxsum argument, whose default is 100 for factors. Try int_pp(x=rep(1.3333,100000)) to reproduce the error.

My patch is:

 # Aggregate the result into a weight vector
   xsumm <- summary(as.factor(xs), maxsum = length(levels(as.factor(xs)))+1)