I recently got into these lines
x <- as.factor(rep(1:4, 2))
x
# [1] 1 2 3 4 1 2 3 4
# Levels: 1 2 3 4
But if I do
x <- factor(rep(1:4, 2))
that gives me the same result. So what is the difference between factor and as.factor? I get how factor is pulling same numbers out and making them levels, but I don't get what the exact differences are between factor and as.factor.