Hello,

I don't know much about r language. So that's why I am asking your help on this, if you can.

I took a code available on internet that I tried to run.

I had a look on the forum but I still struggling.

So here below the error message:

```
Error in `[.data.frame`(df, row_idx, col_names) :
undefined columns selected
```

A code part related to the error message:

```
row_max_prob <- function(df, row_idx, find_max){
predict_outcome <- df[row_idx, "predict_outcome"]
if(is.na(predict_outcome)) return (NA)
col_names <- paste0(betting_house, predict_outcome)
names(df)
val = ifelse(find_max == 1, max(df[row_idx,col_names]), 1 / mean(as.numeric(df[row_idx,col_names])))
return ( val )
}
```

Some help could be great.