

   setNames {nls}                               R Documentation

   SSeett tthhee NNaammeess iinn aann OObbjjeecctt

   DDeessccrriippttiioonn::

        This is a convenience function that sets the names on
        an object and returns the object.  It is most useful at
        the end of a function definition where one is creating
        the object to be returned and would prefer not to store
        it under a name just so the names can be assigned.

   UUssaaggee::

        setNames(object, nm)

   AArrgguummeennttss::

     object: an object for which a `names' attribute will be
             meaningful

         nm: a character vector of names to assign to the
             object

   VVaalluuee::

        An object of the same sort as `object' with the new
        names assigned.

   AAuutthhoorr((ss))::

        Douglas M. Bates and Saikat DebRoy

   SSeeee AAllssoo::

        `clearNames'

   EExxaammpplleess::

        library( nls )
        setNames( 1:3, c("foo", "bar", "baz") )
        # this is just a short form of
        tmp <- 1:3
        names(tmp) <-  c("foo", "bar", "baz")
        tmp

