weeds_ADMB_setup <- function() {
  require(R2admb)
  setup_admb()

  tdata <- read.table("../DATA/weeds.dat",header=TRUE)
  write_dat("../ADMB/weed", list(noObs=nrow(tdata), as.matrix(tdata))) # use name "weed" rather than "weeds" to keep names separate
  
}

weeds_ADMB_fit <- function() { # use functions from very new R2admb 110718
  run_admb("weed") # use name "weed" rather than "weeds" to keep names separate
  L <- read_admb("weed")
  clean_admb("weed")
  return(L)
}

