philmikejones / rakeR

Tools for easy spatial microsimulation (raking) in R
http://philmikejones.github.io/rakeR/
11 stars 1 forks source link

Small bug fix and enhancement #43

Closed virgesmith closed 7 years ago

virgesmith commented 7 years ago

Fixes #41 and #42

philmikejones commented 7 years ago

Thanks for the pull request @virgesmith I've seen the Travis build has failed so will look into this tonight. Looks like a unit test has failed.

virgesmith commented 7 years ago

No probs - trying to work out why travis failed too. Checks and tests were all fine for me. Relevant bit of travis log seems to be `* checking examples ... ERROR Running examples in ‘rakeR-Ex.R’ failed The error most likely occurred in:

base::assign(".ptime", proc.time(), pos = "CheckExEnv")

Name: integerise

Title: integerise

Aliases: integerise

** Examples

cons <- data.frame(

  • "zone" = letters[1:3],
  • "a0_49" = c(8, 2, 7),
  • "a_gt50" = c(4, 8, 4),
  • "f" = c(6, 6, 8),
  • "m" = c(6, 4, 3)
  • )

inds <- data.frame(

  • "id" = LETTERS[1:5],
  • "age" = c("a_gt50", "a_gt50", "a0_49", "a_gt50", "a0_49"),
  • "sex" = c("m", "m", "m", "f", "f"),
  • "income" = c(2868, 2474, 2231, 3152, 2473),
  • stringsAsFactors = FALSE
  • ) vars <- c("age", "sex")

weights <- weight(cons = cons, inds = inds, vars = vars) Error: all.equal(colnames(cons), colnames(ind_cat)) is not TRUE Execution halted'

which I can't reproduce...

philmikejones commented 7 years ago

The latest build failed because of this issue. Restarted.

philmikejones commented 7 years ago

There's a problem with the documentation example for the integerise() function when building on Travis, but I can't reproduce it locally. I need to take a look at this later when I'm less tired!

philmikejones commented 7 years ago

Builds on Precise are working (although now there's a new problem). I'm going to leave this a couple of days until Travis settles down then come back to it. Thank you for your suggestions @virgesmith , I will get around to them when systems are working again!