I want to know the difference between
x.char = c("A", "B", "C")
and
x = c("A", "B", "C")
when should I use x.char instead of x?
thanks
I want to know the difference between
x.char = c("A", "B", "C")
and
x = c("A", "B", "C")
when should I use x.char instead of x?
thanks
It looks like you're coming from programming languages where the dot (.
) means something. Eg in C++, C# and Java, x.foo
means the foo
member of the x
class.
In R, .
is not anything special. It's just another character that you can use in a variable name. In your example, x.char
is a variable, and x
is another variable. There's no difference between the two statements, except that they refer to different variables.