I have the following columns in my data set:
presult aresult I single I double I triple I home run SS st
dataset$base <- as.integer(as.factor(dataset$aresult))
Depending on your data as.factor() could be omitted, because in many cases strings are factor by default, e.g. with read.table