Type error. The right-hand operand of : is supposed to be a list. But head(tail(L)) + 1 is a number.