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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: data.set
> ### Title: Data Set Objects
> ### Aliases: data.set data.set-class initialize,data.set-method is.data.set
> ###   within,data.set-method print,data.set-method show,data.set-method
> ###   summary,data.set-method as.data.frame.data.set str.data.set
> ###   as.data.set as.data.set,list-method [<-,data.set-method
> ###   [,data.set,atomic,atomic,ANY-method
> ###   [,data.set,atomic,missing,ANY-method
> ###   [,data.set,missing,atomic,ANY-method
> ###   [,data.set,missing,missing,ANY-method dim,data.set-method
> ###   dimnames,data.set-method dimnames<-,data.set-method
> ###   row.names,data.set-method head,data.set-method tail,data.set-method
> ###   tail,data.set-method as.data.table.data.set dsView
> 
> ### ** Examples
> 
> Data <- data.set(
+           vote = sample(c(1,2,3,8,9,97,99),size=300,replace=TRUE),
+           region = sample(c(rep(1,3),rep(2,2),3,99),size=300,replace=TRUE),
+           income = exp(rnorm(300,sd=.7))*2000
+           )
> 
> Data <- within(Data,{
+   description(vote) <- "Vote intention"
+   description(region) <- "Region of residence"
+   description(income) <- "Household income"
+   wording(vote) <- "If a general election would take place next tuesday,
+                     the candidate of which party would you vote for?"
+   wording(income) <- "All things taken into account, how much do all
+                     household members earn in sum?"
+   foreach(x=c(vote,region),{
+     measurement(x) <- "nominal"
+     })
+   measurement(income) <- "ratio"
+   labels(vote) <- c(
+                     Conservatives         =  1,
+                     Labour                =  2,
+                     "Liberal Democrats"   =  3,
+                     "Don't know"          =  8,
+                     "Answer refused"      =  9,
+                     "Not applicable"      = 97,
+                     "Not asked in survey" = 99)
+   labels(region) <- c(
+                     England               =  1,
+                     Scotland              =  2,
+                     Wales                 =  3,
+                     "Not applicable"      = 97,
+                     "Not asked in survey" = 99)
+   foreach(x=c(vote,region,income),{
+     annotation(x)["Remark"] <- "This is not a real survey item, of course ..."
+     })
+   missing.values(vote) <- c(8,9,97,99)
+   missing.values(region) <- c(97,99)
+ 
+   # These to variables do not appear in the
+   # the resulting data set, since they have the wrong length.
+   junk1 <- 1:5
+   junk2 <- matrix(5,4,4)
+   
+ })
Warning in within(Data, { :
  Variables 'junk1','junk2' have wrong length, removing them.
> # Since data sets may be huge, only a
> # part of them are 'show'n
> Data

Data set with 300 observations and 3 variables

                   vote               region    income
 1        Conservatives *Not asked in survey 1320.7858
 2          *Don't know             Scotland 3419.1533
 3 *Not asked in survey             Scotland 2055.2487
 4        Conservatives             Scotland 2020.6110
 5               Labour              England 1755.4501
 6      *Answer refused              England 5331.1169
 7 *Not asked in survey              England 2026.0480
 8    Liberal Democrats              England 2381.1520
 9      *Not applicable              England 2220.2098
10               Labour             Scotland 1019.0634
11    Liberal Democrats             Scotland 1909.0781
12    Liberal Democrats             Scotland 4923.3668
13        Conservatives             Scotland 2756.1502
14      *Answer refused                Wales  723.7765
15      *Answer refused              England 2111.2639
16               Labour             Scotland 2959.6584
17      *Not applicable             Scotland 1897.7796
18      *Not applicable *Not asked in survey 3459.1938
19               Labour                Wales 1772.3019
20 *Not asked in survey *Not asked in survey  958.1428
21        Conservatives              England 3332.6343
22 *Not asked in survey *Not asked in survey 2403.7087
23      *Answer refused              England 2926.2089
24      *Answer refused              England 4144.9445
25        Conservatives             Scotland 2296.5351
.. .................... .................... .........
(25 of 300 observations shown)
> 
> ## Not run: 
> ##D 
> ##D # If we insist on seeing all, we can use 'print' instead
> ##D print(Data)
> ## End(Not run)
> 
> str(Data)
Data set with 300 obs. of 3 variables:
 $ vote  : Nmnl. item w/ 7 labels for 1,2,3,... + ms.v.  num  1 8 99 1 2 9 99 3 97 2 ...
 $ region: Nmnl. item w/ 5 labels for 1,2,3,... + ms.v.  num  99 2 2 2 1 1 1 1 1 2 ...
 $ income: Rto. item  num  1321 3419 2055 2021 1755 ...
> summary(Data)
                   vote                     region        income       
 Conservatives       :49   England             :125   Min.   :  267.3  
 Labour              :41   Scotland            : 98   1st Qu.: 1199.2  
 Liberal Democrats   :34   Wales               : 37   Median : 1896.5  
 *Don't know         :45   *Not asked in survey: 40   Mean   : 2508.1  
 *Answer refused     :42                              3rd Qu.: 3221.0  
 *Not applicable     :47                              Max.   :19680.7  
 *Not asked in survey:42                                               
> 
> ## Not run: 
> ##D # If we want to 'View' a data set we can use 'dsView'
> ##D dsView(Data)
> ##D # Works also, but changes the data set into a data frame first:
> ##D View(Data)
> ## End(Not run)
> 
> Data[[1]]

Item 'Vote intention' (measurement: nominal, type: double, length = 300) 

 [1:300] Conservatives *Don't know *Not asked in survey Conservatives Labour ...
> Data[1,]

Data set with 1 observations and 3 variables

           vote               region   income
1 Conservatives *Not asked in survey 1320.786
> head(as.data.frame(Data))
           vote   region   income
1 Conservatives     <NA> 1320.786
2          <NA> Scotland 3419.153
3          <NA> Scotland 2055.249
4 Conservatives Scotland 2020.611
5        Labour  England 1755.450
6          <NA>  England 5331.117
> 
> EnglandData <- subset(Data,region == "England")
> EnglandData

Data set with 0 observations and 3 variables

Error in apply(res, 2, format, justify = "right") : 
  dim(X) must have a positive length
Calls: <Anonymous> ... <Anonymous> -> print.data.set -> print_frame_internal -> apply
Execution halted