From p.dalgaard at biostat.ku.dk  Tue Mar 15 18:05:12 2005
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Tue Mar 15 18:12:13 2005
Subject: [Rd] Lemon drops
Message-ID: <x2r7igon5j.fsf@biostat.ku.dk>

I bumped into the following situation:

Browse[1]> coef
            deg0NA deg4NA deg8NA deg0NP deg4NP deg8NP
(Intercept)    462    510    528    492    660    762
Browse[1]> coef[,1]
[1] 462
Browse[1]> coef[,1,drop=F]
            deg0NA
(Intercept)    462

where I really wanted neither, but

(Intercept)
        462

Anyone happen to know a neat way out of the conundrum?

I can think of

rowSums(coef[,1,drop=F])

or of course

val <- coef[,1]
names(val) <- rownames(x))

but the first one is sneaky and the second gets a bit tedious...

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] Lemon drops
Peter Dalgaard