fields missing from daily_races?

0 votes
Is there a reason that the following fields which are in the historic_races table aren't available in the daily_races table  :- seller, claimer, apprentice, maiden & amateur? Surely they are known beforehand?

Is it simply that the official source doesn't provide this info?
asked Apr 21, 2018 in Smartform by BobBob Plater (190 points)

1 Answer

0 votes

Correct that a) this is known before races and b) the reason is simply the official source doesn't provide this information.

However, it is easy to create these fields for yourself - like many other fields you may wish to add to your own version of Smartform.

The key is to evaluate appropriate regular expressions against the race title field.

Here's an example of an R function that you can adapt for all race types that will create these fields for you by supplying the race_title field in daily races.  Here's one for Selling races:

is.seller <- function(x) {
  
  #x requires the race_title field from either daily_races or historic_races
  race_title = trim(x)
  
  seller_match <- c("Selling")
  seller <- length (grep(paste(seller_match,collapse="|"), x, perl=TRUE)) 
  
  return(seller)
  
}

Alternatively, you can do the same thing in SQL

mysql> select scheduled_time, course, race_title from daily_races where meeting_date = CURDATE() and race_title regexp 'Amateur'; 

+---------------------+-----------+---------------------------------------------------+

| scheduled_time      | course    | race_title                                        |

+---------------------+-----------+---------------------------------------------------+

| 2018-04-22 15:50:00 | Wincanton | McCreery Military Amateur Riders' Handicap Hurdle |

+---------------------+-----------+---------------------------------------------------+

1 row in set (0.11 sec)

Note that there are other race conditions that are currently not included as a separate field for information in the default field set for daily_races or historic_races that are similarly useful for analysis purpoes - and for which you can also adapt the methods above.  For example, races that are exclusively for fillies.

answered Apr 22, 2018 by colin Frankel (19,320 points)
...