Skip to content
Prev 311124 / 398506 Next

coarsening levels problem

Greetings from New Zealand.

I hope that my difficulties are clear from the following output. Ideas 
gratefully received!

Murray Jorgensen

cc <- scan()
  3000 3500 2500 2500 3000 3000 3000 3000 3000 2000
2000 2000 2000 4800 3000 4500 3000 2000 2000 4400
3000 3000 2500 3000 3000 2000 3000 2000 2000 2000 3000 2000

cc <- as.factor(cc)
[1] 3000 3500 2500 2500 3000 3000 3000 3000 3000 2000
[11] 2000 2000 2000 4800 3000 4500 3000 2000 2000 4400
[21] 3000 3000 2500 3000 3000 2000 3000 2000 2000 2000
[31] 3000 2000
Levels: 2000 2500 3000 3500 4400 4500 4800
+                large = c(3500,4400,4500,4800))
[1] L3    large L2.5  L2.5  L3    L3    L3    L3    L3
[10] L2    L2    L2    L2    large L3    large L3    L2
[19] L2    large L3    L3    L2.5  L3    L3    L2    L3
[28] L2    L2    L2    L3    L2
Levels: L2 L2.5 L3 large
reg <-
structure(c(6L, 6L, 1L, 7L, 1L, 1L, 1L, 5L, 2L, 1L, 6L, 3L, 1L,
1L, 7L, 1L, 4L, 1L, 1L, 1L, 1L, 1L, 7L, 6L, 6L, 1L, 1L, 1L, 1L,
6L, 2L, 7L), .Label = c(" auckland", " christchurch", " hb",
" manawatu", " taranaki", " waikato", " wellington"), class = "factor")
[1]  waikato       waikato       auckland
  [4]  wellington    auckland      auckland
  [7]  auckland      taranaki      christchurch
[10]  auckland      waikato       hb
[13]  auckland      auckland      wellington
[16]  auckland      manawatu      auckland
[19]  auckland      auckland      auckland
[22]  auckland      wellington    waikato
[25]  waikato       auckland      auckland
[28]  auckland      auckland      waikato
[31]  christchurch  wellington
7 Levels:  auckland  christchurch  hb ...  wellington
+            "hb", "manawatu", "taranaki", "waikato", "wellington"))
[1] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
[11] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
[21] <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
[31] <NA> <NA>
Levels: akl other