Following my last mail, I found a simple solution using eval(parse)):

df <-
data.frame(depth=c("low","medium","high"),velocity=c("medium","medium","low"),suitability=c("low","medium","low"))
df$rule <- paste("fuzzy_rule(depth %is% ",df[,"depth"]," && ","velocity
%is% ",df[,"velocity"],", ","suitability %is%
",df[,"suitability"],")",sep="")
rules <-
eval(parse(text=paste("set(",paste(df[,"rule"],collapse=","),")",sep="")))

which turns the dataframe into the rules definition object similar to:

rules <-
  set(
    fuzzy_rule(depth %is% low && velocity %is% medium, suitability %is%
low),
    fuzzy_rule(depth %is% medium && velocity %is% medium, suitability %is%
medium),
    fuzzy_rule(depth %is% high && velocity %is% low, suitability %is% low)
  )

/johannes

	[[alternative HTML version deleted]]

