Thats it! Most splendid! Thanks! The final result, just the value alone ,
for future reference.

> x <- c(1,5,3,1)> y <- c(5,8,2,3)> lm(x~y)$coefficient[1](Intercept)
  0.5714286 > cat(lm(x~y)$coefficient[1])0.5714286


>

Thanks everyone!

Regards
Billy






On Sun, Oct 5, 2014 at 10:37 PM, peter dalgaard <pda...@gmail.com> wrote:

>
> On 05 Oct 2014, at 16:06 , billy am <wickedpu...@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....@cbs.dk  Priv: pda...@gmail.com
>
>
>
>
>
>
>
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to