Your data frame does not seem to have come through with the formatting.
Could you send a plain text example (easily created using dput() ) of what
you have now and what you want?
Michael
On Tue, Sep 27, 2011 at 7:24 AM, <Charlotte.Ndiribe@unil.ch> wrote:
> Hi,
>
> I already know row.names(comm)[1:5]<- paste("com", 1:5,
> sep="")
> But, my data looks like e.g.
> plots sp1 sp2
> 1 0.2 0.5
> 2
> 4
> 7
> 10
> I would like to add "com" in front of the plot numbers
> without changing them?
>
> Thank you
>
> ----- Original Message -----
> From: "R. Michael Weylandt" <michael.weylandt@gmail.com>
> To: Charlotte.Ndiribe@unil.ch
> Subject: Re: [R] change rownames
> Date: Tue, 27 Sep 2011 06:39:18 -0400
>
> > I have no idea what you mean by plot numbers, but consider
> > this:
> >
> > x <- data.frame(a = 1:5, b = sin(1:5) , c = letters[1:5])
> > print(x)
> > rownames(x) <- paste(rownames(x),"com")
> > print(x)
> >
> > Hope this helps,
> >
> > Michael Weylandt
> >
> > On Tue, Sep 27, 2011 at 6:33 AM,
> > <Charlotte.Ndiribe@unil.ch> wrote:
> >
> > > Hi All,
> > >
> > > How do I add "com" to the row names of a data frame,
> > > without deleting the plot numbers?
> > > Thanks
> > >
> > > ______________________________________________
> > > 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. >
> >
>
[[alternative HTML version deleted]]