R_カテゴリを融合する - RとLinuxと...

RとLinuxと...


R_カテゴリを融合する

Rの備忘録

faraway, chapter 5, p.98

 library(faraway)
# p.98
data(nes96)
head(nes96)
sPID <- nes96$PID
levels(sPID)
# [1] "strDem"  "weakDem" "indDem"  "indind"  "indRep"
     "weakRep" "strRep"
levels(sPID) <- c("Democrat", "Democrat", "Independent",
    "Independent",  "Independent",  "Republican",  "Republican")

 
Link: Rの備忘録(1737d) 日録2008年_2月(3496d)
Last-modified: 2008-02-26 (火) 13:46:10 (3859d)