I want to create a function that returns the next day
Here is what I got:
next_day <- function(day){
+ week = list('monday','tuesday','wednesday','thursday','friday','saturday','sunday')
+ pos <- index(day, week)
+ if(day=='sunday') return('monday')
+ if match(day,week) return week[pos+1]
Error: unexpected symbol in:
" + if(day=='sunday') return('monday')
+ if match"