#### Overview

R中的一些数据结构，以及mode, class, typeof的区分。

#### Data Structure

R has a wide variety of objects for holding data, including scalars, vectors, matrices, arrays, data frames, and lists. They differ in terms of the type of data they can hold, how they’re created, their structural complexity, and the notation used to identify and access individual elements.

#### class, mode and typeof

###### class

class返回对象的抽象类型（如data.frame）， 可以用来指示一些generic function怎样去处理这个对象。

class represents its abstract type, which tells generic functions like print how to handle it)

###### mode

mode represents how an object is stored in memory (numeric, character, list and function).

Function mode gives information about the mode of an object in the sense of Becker, Chambers & Wilks (1988), and is more compatible with other implementations of the S language

###### typeof

The R specific function typeof returns the type of an R object.

###### mode vs typeof

mode and storage.mode are the old-style types (where storage.mode is more accurate), and typeof is the newer, even more accurate version.

###### 参考

stackoverflow1

stackoverflow2

stackexchange

R Language Definition