Skip to Main Content
Spatial Point Patterns
book

Spatial Point Patterns

by Adrian Baddeley, Ege Rubak, Rolf Turner
November 2015
Intermediate to advanced content levelIntermediate to advanced
828 pages
33h 11m
English
Chapman and Hall/CRC
Content preview from Spatial Point Patterns
Software Essentials 29
2.1.9 Factors
In statistics, a ‘factor’ is a categorical variable, that is, a variable whose values are discrete categories
(e.g., ‘red’, ‘green’, ‘blue’, ‘orange’ or ‘animal’, ‘vegetable ’, ‘mineral’). The possible categories
are called the levels of the factor.
In R factors are represented by ob jects of class "factor". A factor dataset f contains values
f[1], f[2], ..., f[n] w hich are treated as categorical values.
> col <- c("red", "green", "red", "blue",
"blue", "green", "red")
> col
[1] "red" "green" "red" "blue" "blue" "green" "red"
> f <- factor(col)
> f
[1] red green red blue blue green red
Levels: blue green red
Factors are superficially similar to vectors of character strings, but their conceptual nature and prac -
tical ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Visualization Analysis and Design

Visualization Analysis and Design

Tamara Munzner
R in Action, Third Edition

R in Action, Third Edition

Robert I. Kabacoff

Publisher Resources

ISBN: 9781482210217