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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: Estimate.Total.NHT
> ### Title: Narain-Horvitz-Thompson estimates for a total from survey data
> ### Aliases: Estimate.Total.NHT
> ### Keywords: estimates total strata domains
> 
> ### ** Examples
> 
> ##################################
> ## Setting up data to run examples
> ##################################
> data(Sample1)           ## Loads a data frame with the sample to be used in examples
> N         <- 570        ## Defining the population size
> ## Approximating the 2nd order inclusion probabilities with sample based quantitites
> ## (Note: this approximation is only suitable for large-entropy sampling designs)
> require(samplingVarEst) ## Loading the necessary package
> Probs2Mat <- Pkl.Hajek.s(Sample1$InclProbs) ## function from samplingVarEst package
> head(Sample1)           ## Showing the first rows of the sample data to be used
    y1   y2 InclProbs  Weights CharStrataNames StrataSizes CharDoms NumDoms
1 2495 1206 0.7949309 1.257971    SIERRA NORTE          68        B     222
2 1467  662 0.4065956 2.459446    SIERRA NORTE          68        B     222
3  611  297 0.1850375 5.404310    SIERRA NORTE          68        A     111
4 1172  512 0.4272906 2.340328    SIERRA NORTE          68        A     111
5 3180 1618 0.7011948 1.426137    SIERRA NORTE          68        A     111
6 2171 1023 0.5417217 1.845966    SIERRA NORTE          68        A     111
> 
> ############################################################
> ## Example 1: A variable of interest, without stratification
> ############################################################
> Estimate.Total.NHT(MatY.s   = Sample1$y1     ,
+                    VecWk.s  = Sample1$Weights)
Note: MatPkl.s, the joint inclusion probabilities are not provided, VarEst is set to "Hajek".
Note: when using Hajek's approximations, a high-entropy sampling design is assumed.

  Statistic VariableName Estimate Variance   StdErr   AbsErr LInfCI95 LSupCI95
1 Total.NHT   Sample1$y1  3805194 72885932 8537.326 16724.62  3788470  3821919
   Range95 PctCVE    DEff   n   Nhat   fhat
1 33449.24  0.224 0.00061 373 579.84 0.6433
> 
> Estimate.Total.NHT(MatY.s   = Sample1$y1     ,
+                    VecWk.s  = Sample1$Weights,
+                    VarEst   = "HT"           )
Note: MatPkl.s, the joint inclusion probabilities are not provided, VarEst is set to "Hajek".
Note: when using Hajek's approximations, a high-entropy sampling design is assumed.

  Statistic VariableName Estimate Variance   StdErr   AbsErr LInfCI95 LSupCI95
1 Total.NHT   Sample1$y1  3805194 72885932 8537.326 16724.62  3788470  3821919
   Range95 PctCVE    DEff   n   Nhat   fhat
1 33449.24  0.224 0.00061 373 579.84 0.6433
> 
> Estimate.Total.NHT(MatY.s   = Sample1$y1     ,
+                    VecWk.s  = Sample1$Weights,
+                    VarEst   = "SYG"          ,
+                    MatPkl.s = Probs2Mat      )

  Statistic VariableName Estimate Variance   StdErr  AbsErr LInfCI95 LSupCI95
1 Total.NHT   Sample1$y1  3805194 72993017 8543.595 16736.9  3788457  3821931
   Range95 PctCVE    DEff   n   Nhat   fhat
1 33473.81  0.225 0.00061 373 579.84 0.6433
> 
> Estimate.Total.NHT(MatY.s   = Sample1$y1     ,
+                    VecWk.s  = Sample1$Weights,
+                    VarEst   = "SYG"          ,
+                    MatPkl.s = Probs2Mat      ,
+                    PopSize  = N              )

  Statistic VariableName Estimate Variance   StdErr  AbsErr LInfCI95 LSupCI95
1 Total.NHT   Sample1$y1  3805194 72993017 8543.595 16736.9  3788457  3821931
   Range95 PctCVE    DEff   n   Nhat   fhat   N      f
1 33473.81  0.225 0.00065 373 579.84 0.6433 570 0.6544
> 
> 
> ###################################################################################
> ## Example 2: A matrix/dataframe of 2 variables of interest, without stratification
> ###################################################################################
> Estimate.Total.NHT(MatY.s   = Sample1[ ,c("y1","y2")],
+                    VecWk.s  = Sample1$Weights        ,
+                    VarEst   = "SYG"                  ,
+                    MatPkl.s = Probs2Mat              ,
+                    PopSize  = N                      )
Error in dimnames(x) <- dn : 
  length of 'dimnames' [2] not equal to array extent
Calls: Estimate.Total.NHT -> colnames<-
Execution halted