• Interval scaled data: You have interval scaled data when the interval between
adjacent units of measurement is the same, but the zero point is arbitrary. An
everyday example of interval scaled data is our calendar system. Each year has
the same length, but the zero point is arbitrary. In other words, time didn’t start
in the year zero — we simply use a convenient year to start counting. This
means you can add and subtract dates (and all other types of interval scaled
data), but you can’t meaningfully divide dates. Other examples include
longitude, as well as anything else where there can be disagreement about
where the starting point is.
Other examples of interval scaled data can be found in social science research such
as market research.
In R you can use integer or numeric objects to represent interval scaled data.
• Ratio scaled data: This is data where all kinds of mathematical operations are
allowed, in particular the ability to multiply and divide (in other words, take
ratios). Most data in physical sciences are ratio scaled — for example, length,
mass, and speed. In R, you use numeric objects to represent ratio scaled data.
Working with ordered factors
Sometimes data has some kind of natural order in which some elements are in
some sense “better” or “worse” than other elements, but at the same time it’s
impossible to ascribe a meaningful value to these. An example is any situation
where project status is described as low, medium, or high. A similar example is a
traffic light that can be red, yellow, or green.
Summarizing categorical data
In most practical cases where you have categorized data, some values are
repeated. As a practical example, consider the states of the United States.
Each state is in one of four regions: Northeast, South, North Central, or West
(at least according to R). Have a look at the built-in dataset
 South West West South West West
Levels: Northeast South North Central West
You can use the handy
function to get a tabular summary of the
values of a factor: