[R] Make a column from columns

Gerrit Eichner Gerrit.Eichner at math.uni-giessen.de
Thu Jan 3 10:49:50 CET 2013


Hi, Aseem,

you may want to look at

?stack

or

?reshape

(and transform your matrix into a data frame).

   Hth  --  Gerrit

On Wed, 2 Jan 2013, Aseem Sharma wrote:

> Hi,
> I have a data matrix with 13 columns and 55 rows.  First coulmn is year and
> other are monthly values for 55 years.
> Now i want to create a single column of all the values ( i e  a single time
> series column from column 2 to 13 ).
> Is it the for loop that works here ...how ?
> or how i can rearrange the data so that it becomes a times series column.
> hope i made the question clear .
> thank you,
>
>
> ------------------
>
> "Namaste नमस्ते"
>
> Aseem Sharma
>
> Graduate Research Assistant
>
> Northern Hydrometeorology Group(NHG)
>
> Natural Resources and Environmental Studies Institute(NRESi)
>
> University of Northern British Columbia
>
> Prince George, BC, V2N 4Z9, Canada
>
> Tel: 250-960-5427
>
> Web: http://www.unbc.ca/
>
>
> "All know the Way, but few actually walk it."
> "सबैको कल्याण होस् ।"
>
> 	[[alternative HTML version deleted]]


More information about the R-help mailing list