I'm having trouble converting a .csv column of data with weekdays to a number (so that 1 = Monday, 2 = Tuesday, 3 = Wednesday, etc). I'm trying to use the strptime feature as shown here: http://www.inside-r.org/r-doc/base/strftime
Since I want to convert the weekday to a number, I used the "%u" formatting option. Here's my code below:
> newweekdaynum <- strptime(SFCrimeData$DayOfWeek, "%u")
where SFCrimeData is a data set I have that has a bunch of crime information. No errors come up after I run the statement, but when I want to print "newweekdaynum" all that comes is a huge table of values that all say "NA".
What am I doing wrong?