[R] Removing description from lm()

peter dalgaard pdalgd at gmail.com
Sun Oct 5 16:37:45 CEST 2014


On 05 Oct 2014, at 16:06 , billy am <wickedpuppy at gmail.com> wrote:

> Thank you both very much. It is the unname that is what I am looking for.
> Thanks!
> 
> Btw , must the [1] be there? I am writing a Shiny web app hence I would
> like to display the value alone.
> 

It's part of standard printing of unnamed vectors. For nonstandard printing tasks, use cat() as in

> x <-c(a=2)
> x
a 
2 
> cat(x,"\n")
2 

(which incidentally also gets rid of the name).

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list