You aren't stating where your data come from. If you use read.csv
on a file, you'll have the items separated into columns immediately. You can even get them from the keyboard, e.g.:
read.csv(stdin(),header=FALSE)
0: 300,hello,40.2
1:
# V1 V2 V3
# 1 300 hello 40.2
Then you could do foo<- dat$V3%%10
, as in my comment above, to get the last digit.