Pergunta

In reading Hadley Wickham's Advanced R I learned about the difference between atomic vectors and lists; and matrices/arrays and dataframes. This is something I hadn't really appreciated before, and seems to make sense.

My question is, if lists and dataframes are more flexible (i.e. they allow multiple data types) why use atomic vectors and matrices at all if they are more restrictive?

I guess it may affect performance, but I don't know.

Foi útil?

Solução

I asked Hadley Wickham on Twitter who replied:

@philmikejones data frames are built with atomic vectors + you always want to use simplest thing that works

— Hadley Wickham (@hadleywickham) March 18, 2015
Licenciado em: CC-BY-SA com atribuição
scroll top