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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: utility-package
> ### Title: Construct, Evaluate and Plot Value and Utility Functions
> ### Aliases: utility-package utility
> ### Keywords: decision analysis; objectives hierarchy; value function;
> ###   utility function
> 
> ### ** Examples
> 
> # define discrete end node for width variability
> # (attribute "widthvariability_class" with levels "high", 
> # "moderate" and "none")
> 
> widthvar <- 
+   utility.endnode.discrete.create(
+     name.node     = "width variability",
+     attrib.levels = data.frame(widthvariability_class=
+       c("high","moderate","none")),
+     u             = c(1,0.4125,0),
+     names.u       = c("u.high","u_moderate","u.none"),
+     required      = FALSE,
+     utility       = FALSE)
> 
> # define 1d interpolation end node for bed modification with 
> # riprap
> # (attribute "bedmodfract_percent" with levels from 0 to 100)
> 
> bedmod_riprap <-
+   utility.endnode.intpol1d.create(
+     name.node   = "bed modification riprap",
+     name.attrib = "bedmodfract_percent",
+     range       = c(0,100),
+     x           = c(0,10,30,100),
+     u           = c(1,0.775,0.5625,0.24),
+     required    = FALSE,
+     utility     = FALSE)
> 
> # define 1d interpolation end node for bed modification with 
> # other material
> # (attribute "bedmodfract_percent" with levels from 0 to 100)
> 
> bedmod_other <-
+   utility.endnode.intpol1d.create(
+     name.node   = "bed modification other",
+     name.attrib = "bedmodfract_percent",
+     range       = c(0,100),
+     x           = c(0,10,30,100),
+     u           = c(1,0.775,0.5625,0),
+     required    = FALSE,
+     utility     = FALSE)
> 
> # define combination end node for bed modification
> # (attributes "bedmodtype_class" and "bedmodfract_percent")
> 
> bedmod <-
+   utility.endnode.cond.create(
+     name.node     = "bed modification",
+     attrib.levels = data.frame(bedmodtype_class=
+       c("riprap","other")),
+     nodes         = list(bedmod_riprap,bedmod_other),
+     required      = FALSE,
+     utility       = FALSE)
> 
> # define 1d interpolation end node for bank modification with 
> # permeable material
> # (attribute "bankmodfract_percent" with levels from 0 to 100)
> 
> bankmod_perm <-
+   utility.endnode.intpol1d.create(
+     name.node   = "bank modification perm",
+     name.attrib = "bankmodfract_percent",
+     range       = c(0,100),
+     x           = c(0,10,30,60,100),
+     u           = c(1,0.8667,0.675,0.4125,0.24),
+     required    = FALSE,
+     utility     = FALSE)
> 
> # define 1d interpolation end node for bank modification with 
> # impermeable material
> # (attribute "bankmodfract_percent" with levels from 0 to 100)
> 
> bankmod_imperm <-
+   utility.endnode.intpol1d.create(
+     name.node   = "bank modification imperm",
+     name.attrib = "bankmodfract_percent",
+     range       = c(0,100),
+     x           = c(0,10,30,60,100),
+     u           = c(1,0.775,0.5625,0.24,0),
+     required    = FALSE,
+     utility     = FALSE)
> 
> # define combination end node for bank modification
> # (attributes "bankmodtype_class" and "bankmodfract_percent")
> 
> bankmod <-
+   utility.endnode.cond.create(
+     name.node     = "bank modification",
+     attrib.levels = data.frame(bankmodtype_class=
+       c("perm","imperm")),
+     nodes         = list(bankmod_perm,bankmod_imperm),
+     required      = FALSE,
+     utility       = FALSE)
> 
> # define 2d interpolation end node for riparian zone width
> # (attributes "riparianzonewidth_m" and "riparianzonewidth_m")
> 
> riparzone_width <-
+   utility.endnode.intpol2d.create(
+     name.node   = "riparian zone width",
+     name.attrib = c("riverbedwidth_m","riparianzonewidth_m"),
+     ranges      = list(c(0,16),c(0,30)),
+     isolines    = list(list(x=c(0,16),y=c(0,0)),
+                        list(x=c(0,2,10,16),y=c(5,5,15,15)),
+                        list(x=c(0,16),y=c(15,15)),
+                        list(x=c(0,16),y=c(30,30))),
+     u           = c(0.0,0.6,1.0,1.0),
+     lead         = 1,
+     utility      = FALSE)
> 
> # define discrete end node for riparian zone vegetation
> # (attriute "riparianzoneveg_class" with levels "natural", 
> # "seminatural" and "artificial")
> 
> riparzone_veg <-
+   utility.endnode.discrete.create(
+     name.node     = "riparian zone veg.",
+     attrib.levels = data.frame(riparianzoneveg_class=
+       c("natural","seminatural","artificial")),
+     u             = c(1,0.5625,0),
+     required      = FALSE,
+     utility       = FALSE)
> 
> # define aggregation node for riparian zone
> 
> riparzone <-
+   utility.aggregation.create(
+     name.node = "riparian zone",
+     nodes     = list(riparzone_width,riparzone_veg),
+     name.fun  = "utility.aggregate.cobbdouglas",
+     par       = c(1,1),
+     required  = FALSE)
> 
> # define aggregation node for ecomorphological state
> 
> morphol <-
+   utility.aggregation.create(
+     name.node = "ecomorphology",
+     nodes     = list(widthvar,bedmod,bankmod,riparzone),
+     name.fun  = "utility.aggregate.mix",
+     par       = c(0.25,0.25,0.25,0.25,0,0,1),
+     names.par = c("w_widthvar","w_bedmod","w_bankmod","w_riparzone",
+                   "w_add","w_min","w_cobbdouglas"),
+     required  = TRUE)
> 
> # print individual definitions
> 
> print(widthvar)
-------------------------------------------------- 
width variability 
----------------- 
utility/value discrete attribute end node 
attribute(s):    widthvariability_class 
function type:   value 
required:        FALSE 
attribute/value combinations: 
  widthvariability_class      u    names.u
1                   high 1.0000     u.high
2               moderate 0.4125 u_moderate
3                   none 0.0000     u.none
-------------------------------------------------- 
> print(bedmod)
-------------------------------------------------- 
bed modification 
---------------- 
utility/value conditional combination end node 
function type:   value 
required:        FALSE 
attribute/node combinations: 
  bedmodtype_class                    node
1           riprap bed modification riprap
2            other  bed modification other
** 
bed modification riprap 
----------------------- 
utility/value 1d interpolation end node 
attribute:       bedmodfract_percent 
attribute range: 0 - 100 
function type:   value 
required:        FALSE 
data pairs: 
  names.x   x      u names.u
1           0 1.0000        
2          10 0.7750        
3          30 0.5625        
4         100 0.2400        
** 
bed modification other 
---------------------- 
utility/value 1d interpolation end node 
attribute:       bedmodfract_percent 
attribute range: 0 - 100 
function type:   value 
required:        FALSE 
data pairs: 
  names.x   x      u names.u
1           0 1.0000        
2          10 0.7750        
3          30 0.5625        
4         100 0.0000        
-------------------------------------------------- 
> 
> # print all definitions
> 
> print(morphol)
-------------------------------------------------- 
ecomorphology 
------------- 
utility/value aggregation node 
nodes:           width variability (end node) 
                 bed modification (end node) 
                 bank modification (end node) 
                 riparian zone 
function:        utility.aggregate.mix 
parameters: 
      names.par  par
1    w_widthvar 0.25
2      w_bedmod 0.25
3     w_bankmod 0.25
4   w_riparzone 0.25
5         w_add 0.00
6         w_min 0.00
7 w_cobbdouglas 1.00
function type:   value 
required:        TRUE 
required nodes:  1 
*** 
width variability 
----------------- 
utility/value discrete attribute end node 
attribute(s):    widthvariability_class 
function type:   value 
required:        FALSE 
attribute/value combinations: 
  widthvariability_class      u    names.u
1                   high 1.0000     u.high
2               moderate 0.4125 u_moderate
3                   none 0.0000     u.none
*** 
bed modification 
---------------- 
utility/value conditional combination end node 
function type:   value 
required:        FALSE 
attribute/node combinations: 
  bedmodtype_class                    node
1           riprap bed modification riprap
2            other  bed modification other
** 
bed modification riprap 
----------------------- 
utility/value 1d interpolation end node 
attribute:       bedmodfract_percent 
attribute range: 0 - 100 
function type:   value 
required:        FALSE 
data pairs: 
  names.x   x      u names.u
1           0 1.0000        
2          10 0.7750        
3          30 0.5625        
4         100 0.2400        
** 
bed modification other 
---------------------- 
utility/value 1d interpolation end node 
attribute:       bedmodfract_percent 
attribute range: 0 - 100 
function type:   value 
required:        FALSE 
data pairs: 
  names.x   x      u names.u
1           0 1.0000        
2          10 0.7750        
3          30 0.5625        
4         100 0.0000        
*** 
bank modification 
----------------- 
utility/value conditional combination end node 
function type:   value 
required:        FALSE 
attribute/node combinations: 
  bankmodtype_class                     node
1              perm   bank modification perm
2            imperm bank modification imperm
** 
bank modification perm 
---------------------- 
utility/value 1d interpolation end node 
attribute:       bankmodfract_percent 
attribute range: 0 - 100 
function type:   value 
required:        FALSE 
data pairs: 
  names.x   x      u names.u
1           0 1.0000        
2          10 0.8667        
3          30 0.6750        
4          60 0.4125        
5         100 0.2400        
** 
bank modification imperm 
------------------------ 
utility/value 1d interpolation end node 
attribute:       bankmodfract_percent 
attribute range: 0 - 100 
function type:   value 
required:        FALSE 
data pairs: 
  names.x   x      u names.u
1           0 1.0000        
2          10 0.7750        
3          30 0.5625        
4          60 0.2400        
5         100 0.0000        
*** 
riparian zone 
------------- 
utility/value aggregation node 
nodes:           riparian zone width (end node) 
                 riparian zone veg. (end node) 
function:        utility.aggregate.cobbdouglas 
parameters: 
  names.par par
1             1
2             1
function type:   value 
required:        FALSE 
required nodes:  1 
*** 
riparian zone width 
------------------- 
utility/value 2d interpolation end node 
attributes:       riverbedwidth_m , riparianzonewidth_m 
attribute ranges: 0 - 16 , 0 - 30 
function type:    value 
required:         FALSE 
isolines: 
u: 0     
  names.x  x y names.y
1          0 0        
2         16 0        
u: 0.6     
  names.x  x  y names.y
1          0  5        
2          2  5        
3         10 15        
4         16 15        
u: 1     
  names.x  x  y names.y
1          0 15        
2         16 15        
u: 1     
  names.x  x  y names.y
1          0 30        
2         16 30        
*** 
riparian zone veg. 
------------------ 
utility/value discrete attribute end node 
attribute(s):    riparianzoneveg_class 
function type:   value 
required:        FALSE 
attribute/value combinations: 
  riparianzoneveg_class      u names.u
1               natural 1.0000        
2           seminatural 0.5625        
3            artificial 0.0000        
-------------------------------------------------- 
> 
> # plot objectives hierarchy with attributes
> 
> plot(morphol)
> 
> # plot individual nodes:
> 
> plot(widthvar)
> plot(widthvar,par=c(u_moderate=0.2))
> plot(bedmod_other)
> plot(bankmod)
> #plot(riparzone_width)   # too slow for package installation
> 
> # plot selected node definitions of a hierarchy
> 
> plot(morphol,type="nodes",nodes=c("width variability",
+                                   "bed modification other",
+                                   "bank modification"))
> 
> # evaluate value function for data sets and plot colored hierarchies
> # and table
> 
> attrib_channelized <- data.frame(widthvariability_class = "none",
+                                  bedmodtype_class       = "riprap",
+                                  bedmodfract_percent    = 50,
+                                  bankmodtype_class      = "imperm",
+                                  bankmodfract_percent   = 70,
+                                  riverbedwidth_m        = 10,
+                                  riparianzonewidth_m    = 5,
+                                  riparianzoneveg_class  = "seminatural")
> attrib_rehab       <- data.frame(widthvariability_class = "high",
+                                  bedmodtype_class       = "riprap",
+                                  bedmodfract_percent    = 50,
+                                  bankmodtype_class      = "imperm",
+                                  bankmodfract_percent   = 20,
+                                  riverbedwidth_m        = 15,
+                                  riparianzonewidth_m    = 15,
+                                  riparianzoneveg_class  = "natural")
> 
> res_channelized     <- evaluate(morphol,attrib=attrib_channelized)
> res_channelized_add <- evaluate(morphol,attrib=attrib_channelized,
+                                 par=c(w_add=1,w_min=0,w_cobbdouglas=0))
> res_rehab           <- evaluate(morphol,attrib=attrib_rehab)
> res_both            <- rbind(res_channelized,res_rehab)
> rownames(res_both)  <- c("channelized","rehabilitated")
> 
> plot(morphol,u=res_channelized)
Error in `[.data.frame`(u.local, , rownames(str)[i]) : 
  undefined columns selected
Calls: plot ... utility.plot -> utility.plothierarchy -> [ -> [.data.frame
Execution halted