[R] truncate row names

From: Summer Nitely <summer.nitely_at_gmail.com>
Date: Thu, 24 Apr 2008 10:47:40 -0600


I would like to truncate row names. Is that possible?

I ran a regression with the covariates in a matrix, and in the results the coefficients have the matrix name concatenated with the variable name:

> full.t.ag <- Icens(lfirst_well, llast_well, lfirst_ill, formula=~ t.ag.X,
breaks=t.ag.int, data=t.ag)
> full.t.ag$cov$coeff

  t.ag.Xnyearc t.ag.Xhorse t.ag.Xswine t.ag.Xpet t.ag.Xother t.ag.Xpoultry t.ag.Xyr.horse

   -0.29497437 0.77857817 -0.53315929 -1.02745065 -0.17775268 -0.08237047 -0.36606818

I want these coefficients to have the t.ag.X removed from the names. ie.

nyearc                horse             swine
pet                other              poultry             yr.horse
   -0.29497437     0.77857817    -0.53315929    -1.02745065
-0.17775268 -0.08237047 -0.36606818

I have a lot of results, so going through and renaming every row is not a very appealing option. Is there another way? Is there a way to cut off the first 5 character positions in the row name? Or to force R to take the column names rather than concatenate the matrix and column names in the regression?

Any help would be greatly appreciated.

        [[alternative HTML version deleted]]

R-help_at_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. Received on Thu 24 Apr 2008 - 16:50:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 Apr 2008 - 19:30:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive