[R] melting columns

Peter Ehlers ehlers at ucalgary.ca
Thu Oct 22 14:36:37 CEST 2009


You're too vague about what you want.
Do you want to convert

  time freq
     1   10
     2   20
     3   30

to

   tf
  "1 10"
  "2 20"
  "3 30"

(use paste())

or to

   x
   1
   2
   3
  10
  20
  30

(use c())

or ??

  -Peter Ehlers

Thibault Grava wrote:
> Hello,
> 
> I'm using  R to run a acoustic analysis software called Seewave. I ask the code to extract a list of variables from my recording, and the program give ONE table for each of these. The tables consist of a two column data.frame with the time in column 1 and the frequency in column 2. However, for my purpose I need only one column with the time first and the frequency second. I tried different things but my knowledge in R is definitely too low to answer that. Thanks for your help!
> 
> Thibault Grava
> 
> PhD candidate
> Natural Resources and Environmental Studies
> University of Northern British Columbia
> Prince George, BC   V2N 4Z9
> ------------------------
> Tel: (250) 960-6050
> email:grava at unbc.ca
> 
> ______________________________________________
> 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.
> 
>




More information about the R-help mailing list