Can someone please explain the following behavior?

 

df1 and df2 are data.frames. Suppose I want a subset of the rows
(observations) using extraction, say just the first row. What I want to know
is why if df1 has just one column then df1[1,] returns a vector, whereas if
df2 has 2 or more columns then df2[1,] returns a data frame? Why is the
single column case different?


	[[alternative HTML version deleted]]

