Running examples in ‘PracTools-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: deff
> ### Title: Design effects of various types
> ### Aliases: deff
> ### Keywords: methods survey
> 
> ### ** Examples
> 
> require(reshape)      # has function that allows renaming variables
Loading required package: reshape
> require(sampling)
Loading required package: sampling
> 
> set.seed(-500398777)
>     # generate population using HMT function
> pop.dat <- as.data.frame(HMT())
> mos <- pop.dat$x
> pop.dat$prbs.1d <- mos / sum(mos)
>     # select pps sample
> n <- 80
> pk <- n * pop.dat$prbs.1d
> sam <- UPrandomsystematic(pk)
> sam <- sam==1
> 
> sam.dat <- pop.dat[sam, ]
> dsgn.wts <- 1/pk[sam]
> deff(w=dsgn.wts, type="kish")
[1] 1.970746
> deff(w=dsgn.wts, y=sam.dat$y, p=sam.dat$prbs.1d, type="spencer")
[1] 0.5271688
> deff(w=dsgn.wts, x=sam.dat$x, y=sam.dat$y, type="henry")
[1] 0.8547867
> 
> 
> data(MDarea.pop)
> Ni <- table(MDarea.pop$TRACT)
> m <- 10
> probi <- m*Ni / sum(Ni)
>     # select sample of clusters
> set.seed(-780087528)
> sam <- cluster(data=MDarea.pop, clustername="TRACT", size=m, method="systematic",
+                 pik=probi, description=TRUE)
Number of selected clusters: 10 
Number of units in the population and number of selected units: 403997 67098 
>     # extract data for the sample clusters
> samclus <- getdata(MDarea.pop, sam)
> samclus <- rename(samclus, c(Prob = "pi1"))
>     # treat sample clusters as strata and select srswor from each
> nbar <- 4
> s <- strata(data = as.data.frame(samclus), stratanames = "TRACT",
+             size = rep(nbar,m), method="srswor")
>     # extracts the observed data
> samdat <- getdata(samclus,s)
> samdat <- rename(samdat, c(Prob = "pi2"))
>     # add a fake stratum ID
> H <- 2
> nh <- m * nbar / H
> stratum <- NULL
> for (h in 1:H){
+     stratum <- c(stratum, rep(h,nh))
+ }
> wt <- 1/(samdat$pi1*samdat$pi2) * runif(m*nbar)
> samdat <- cbind(subset(samdat, select = -c(Stratum)), stratum, wt)
> deff(w = samdat$wt, y=samdat$y2, strvar = samdat$stratum, clvar = samdat$TRACT, Wh=NULL, type="cr")
Error in loadNamespace(x) : there is no package called ‘survey’
Calls: deff ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted