Re: [R] column name handling and long labels

From: Werner Wernersen <pensterfuzzer_at_yahoo.de>
Date: Thu, 21 Feb 2008 20:26:21 +0100 (CET)


That's perfect! The subset way is very easy to use and I have to play around a bit more with label() which seems quite complex.

Thanks a million,
  Werner

> On Thu, Feb 21, 2008 at 6:09 AM, Werner Wernersen
> <pensterfuzzer_at_yahoo.de> wrote:
> > Hi,
> >
> > I have two loosely related questions which could
> make
> > my live again a bit easier:
> >
> > 1) Is there a simple way to select a range of
> columns
> > in a data frame using column names?
> > I am thinking of something like
> mydf[1,"col4":"col8"]
>
> Try this using builtin data frame anscombe which has
> columns
> x1 to x4 followed by y1 to y4:
>
> subset(anscombe, select = x3:y2)
>
> >
> > 2) I have a data frame with many columns and they
> all
> > have short variable names which is good in most
> cases
> > but sometimes it would be nice to have also a
> longer
> > descriptive name / label attached to the variable
> > which could then be used for printing and latex
> > output. Has anybody come up with a convenient way
> to
> > do that?
> > Right now, I am using always match or merge in
> case of
> > row names.
> >
>
> See ?label in package Hmisc.
>
> > Many thanks,
> > Werner
>

      Machen Sie Yahoo! zu Ihrer Startseite. Los geht's:



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 21 Feb 2008 - 19:30:53 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 21 Feb 2008 - 20:30:16 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