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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: bws.dataset
> ### Title: Creating a data set suitable for BWS analysis on the basis of
> ###   counting and modeling approaches
> ### Aliases: bws.dataset
> ### Keywords: datagen survival
> 
> ### ** Examples
> 
> ## load packages
> require(DoE.base) # include oa.design() used to generate a two-level OMED
Loading required package: DoE.base
Loading required package: grid
Loading required package: conf.design

Attaching package: ‘DoE.base’

The following objects are masked from ‘package:stats’:

    aov, lm

The following object is masked from ‘package:graphics’:

    plot.design

The following object is masked from ‘package:base’:

    lengths

> require(crossdes) # include find.BIB() used to generate a BIBD
Loading required package: crossdes
Loading required package: AlgDesign
Loading required package: gtools
> require(survival) # include clogit() used to analyze responses
Loading required package: survival
> 
> ## case 1: BWS using a two-level OMED
> ## suppose that ten respondents answered twelve BWS questions valuing nine items
> 
> # create a two-level OMED with nine factors
> set.seed(123) # set seed for random number generator
> des1 <- oa.design(nfactors = 9, nlevels = 2)
The columns of the array have been used in order of appearance. 
For designs with relatively few columns, 
the properties can sometimes be substantially improved 
using option columns with min3 or even min34.

> des1 # resultant design with twelve rows, nine columns, and level values of 1 and 2
   A B C D E F G H J
1  1 2 1 1 2 1 2 2 2
2  2 1 2 2 2 1 1 1 2
3  1 2 1 2 2 2 1 1 1
4  2 1 1 2 1 2 2 2 1
5  2 2 2 1 1 1 2 1 1
6  1 1 1 2 1 1 2 1 2
7  2 2 2 2 2 2 2 2 2
8  2 2 1 1 1 2 1 1 2
9  1 1 2 1 2 2 2 1 1
10 1 1 2 1 1 2 1 2 2
11 1 2 2 2 1 1 1 2 1
12 2 1 1 1 2 1 1 2 1
class=design, type= oa 
> 
> # set item names, in which the order of elements corresponds to 
> #  the order of columns in des1
> items1 <- LETTERS[1:9] # item names are "A", "B", ..., "I"
> 
> # create questions for BWS
> bws.questionnaire(
+  choice.sets = des1,
+  design.type = 1, # OMED
+  item.names = items1)

Q1
 Best Items Worst
 [ ]  B     [ ]  
 [ ]  E     [ ]  
 [ ]  G     [ ]  
 [ ]  H     [ ]  
 [ ]  I     [ ]  

Q2
 Best Items Worst
 [ ]  A     [ ]  
 [ ]  C     [ ]  
 [ ]  D     [ ]  
 [ ]  E     [ ]  
 [ ]  I     [ ]  

Q3
 Best Items Worst
 [ ]  B     [ ]  
 [ ]  D     [ ]  
 [ ]  E     [ ]  
 [ ]  F     [ ]  

Q4
 Best Items Worst
 [ ]  A     [ ]  
 [ ]  D     [ ]  
 [ ]  F     [ ]  
 [ ]  G     [ ]  
 [ ]  H     [ ]  

Q5
 Best Items Worst
 [ ]  A     [ ]  
 [ ]  B     [ ]  
 [ ]  C     [ ]  
 [ ]  G     [ ]  

Q6
 Best Items Worst
 [ ]  D     [ ]  
 [ ]  G     [ ]  
 [ ]  I     [ ]  

Q7
 Best Items Worst
 [ ]  A     [ ]  
 [ ]  B     [ ]  
 [ ]  C     [ ]  
 [ ]  D     [ ]  
 [ ]  E     [ ]  
 [ ]  F     [ ]  
 [ ]  G     [ ]  
 [ ]  H     [ ]  
 [ ]  I     [ ]  

Q8
 Best Items Worst
 [ ]  A     [ ]  
 [ ]  B     [ ]  
 [ ]  F     [ ]  
 [ ]  I     [ ]  

Q9
 Best Items Worst
 [ ]  C     [ ]  
 [ ]  E     [ ]  
 [ ]  F     [ ]  
 [ ]  G     [ ]  

Q10
 Best Items Worst
 [ ]  C     [ ]  
 [ ]  F     [ ]  
 [ ]  H     [ ]  
 [ ]  I     [ ]  

Q11
 Best Items Worst
 [ ]  B     [ ]  
 [ ]  C     [ ]  
 [ ]  D     [ ]  
 [ ]  H     [ ]  

Q12
 Best Items Worst
 [ ]  A     [ ]  
 [ ]  E     [ ]  
 [ ]  H     [ ]  

> 
> # set a respondent data set in a row number format
> res1 <- data.frame(
+  ID  = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), # id variable
+  B1  = c(1, 1, 1, 1, 3, 5, 1, 1, 1, 1),  # best item in question 1
+  W1  = c(5, 5, 3, 5, 4, 1, 4, 2, 4, 3),  # worst item in question 1
+  B2  = c(1, 3, 1, 4, 1, 2, 3, 2, 1, 2),  # best item in question 2
+  W2  = c(5, 5, 5, 5, 3, 5, 1, 4, 4, 5),  # worst item in question 2
+  B3  = c(1, 2, 1, 2, 4, 1, 1, 3, 1, 3),  # best item in question 3
+  W3  = c(4, 3, 3, 3, 3, 4, 4, 2, 3, 4),  # worst item in question 3
+  B4  = c(2, 1, 3, 5, 2, 3, 1, 1, 2, 5),  # best item in question 4
+  W4  = c(4, 4, 5, 3, 5, 5, 3, 5, 4, 3),  # worst item in question 4
+  B5  = c(2, 3, 3, 2, 2, 2, 2, 1, 3, 2),  # best item in question 5
+  W5  = c(4, 4, 4, 4, 3, 4, 4, 4, 4, 3),  # worst item in question 5
+  B6  = c(2, 1, 1, 3, 3, 3, 1, 1, 1, 1),  # best item in question 6
+  W6  = c(1, 2, 3, 2, 1, 2, 3, 2, 2, 3),  # worst item in question 6
+  B7  = c(3, 3, 1, 1, 3, 6, 1, 2, 1, 7),  # best item in question 7
+  W7  = c(9, 6, 8, 4, 8, 2, 6, 5, 4, 6),  # worst item in question 7
+  B8  = c(2, 1, 2, 2, 2, 1, 1, 3, 1, 1),  # best item in question 8
+  W8  = c(3, 3, 3, 3, 4, 4, 4, 4, 3, 4),  # worst item in question 8
+  B9  = c(2, 1, 3, 1, 4, 2, 3, 4, 1, 1),  # best item in question 9
+  W9  = c(3, 2, 2, 3, 3, 3, 2, 2, 3, 4),  # worst item in question 9
+  B10 = c(1, 1, 1, 1, 1, 1, 1, 4, 3, 3),  # best item in question 10
+  W10 = c(4, 2, 2, 4, 4, 3, 4, 2, 4, 4),  # worst item in question 10
+  B11 = c(2, 1, 3, 3, 3, 2, 1, 2, 2, 4),  # best item in question 11
+  W11 = c(1, 4, 4, 1, 1, 4, 4, 4, 1, 1),  # worst item in question 11
+  B12 = c(2, 2, 1, 1, 1, 1, 3, 2, 1, 2),  # best item in question 12
+  W12 = c(3, 3, 2, 3, 3, 2, 2, 3, 3, 3))  # worst item in question 12
> 
> # create a data set for analysis 
> #  by combining the choice sets and respondent data set
> dat1 <- bws.dataset(
+  respondent.dataset = res1,
+  response.type = 1, # row number format
+  choice.sets = des1,
+  design.type = 1)   # OMED
> 
> # analyze responses to BWS questions
> # counting approach
> bws1 <- bws.count(dat1)
Error in nrow(dd) : object 'dd' not found
Calls: bws.count ... by.data.frame -> structure -> eval -> eval -> tapply -> nrow
Execution halted