The initialization method easiest to remember is
vec = vector(,10); #the same as "vec = vector(length = 10);"
The values of vec are: "[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE" (logical mode) by default.
But after setting a character value, like
vec[2] = 'abc'
vec becomes: "FALSE" "abc" "FALSE" "FALSE" "FALSE" "FALSE" "FALSE" "FALSE" "FALSE" "FALSE"", which is of the character mode.