I'm still unsure how to make it into a vector, so I just added the lapply function to the previous code so that it will work.
Merge branch 'master' of https://github.com/zhuob/Project2-Bigdata