August 22, 2005

Thinking in Data (3)—expand our class system

Filed under: Causal inference and statistics, Uncategorized — xlsyu @ 6:37 pm

Boy, we’ve come a long way. My data object system gets more and more complicate. I have also corrected many errors (stealthily) in my previous posts. If you haven’t reread my previous posts, let me recapitulate the status quo of the data object system.

We have several atomic object types: number, character, logical value, missing value, and raw value. Vectors comprise these object types are atomic vectors. They are building blocks in our system. The type of vector is determined by its components. To avoid confusion, we now call the object type “mode”, and reserve “class” for a more extensive classification purpose. Therefore, for every object, it has four default attributes: class, mode, length, and name. It also has at least one method: indexing method.

A list class is a versatile tool which can combine all kinds of objects into one object. A data.frame class is a table like object type which is developed from the list class. Thus, the mode of the data.frame class is “list”, which indicates that data.frame is indeed a list.

(more…)

Thinking in Data (2): organizing data and more objects

Filed under: Causal inference and statistics, Uncategorized — xlsyu @ 1:43 am

OK, let’s continue our expedition on data. In the previous section, I introduced the list class (object type) in the need of combining different types of vectors such as numbers and strings into one object. However, that introduction is somewhat unfair to the list class. In fact, list can consist of any objects including list objects. That is, it can be recursive. This is true in R/S, and I believe there are comparable object types in C++ and JAVA. After all, you need something versatile enough to accommodate the whole universe.

Now we have the almighty list class and we have also said that vector is the basis of all objects in our data object system, which means list also belongs to the vector class. This is kind of confusing. All objects inside a vector must have the same class but list can include any objects. How could a list also be a vector? Please read on.

(more…)


Freely hosted by www.xlogit.com. Powered by WordPress.