Re: [R] samples to dataframes

From: David Barron <mothsailor_at_googlemail.com>
Date: Wed 11 Oct 2006 - 18:22:30 GMT

I'm not familiar with seewave package, but I imagine what you have to do is extract the sound component of the sample object and convert that to a data frame.

> waveLeft <- 2*((seq(0,80,length=88200)%%1^2)-.5)
> s <- as.Sample(waveLeft,44100,16)
> ds <- data.frame(s$sound)
> is.data.frame(ds)

[1] TRUE On 11/10/06, randy zelick <zelickr@pdx.edu> wrote:
>
> Hello all,
>
> I'll bet this is not complicated, but I really did hunt for information
> on it, and tried some ideas without success.
>
> Running Windows XP and R 2.3.1
>
> I am using the Sound package to read in .wav files, and this works fine.
> The R object produced is of class "sample". I want to use some of the
> functions in the package Seewave to do further analysis, but this
> package wants data objects to be dataframes. So I tried various ways to
> coerce samples to dataframes, but was not successful.
>
> Does anyone have a hint/solution?
>
> Thanks much,
>
> =Randy=
>
> --
> Randy Zelick email: zelickr@pdx.edu
> Department of Biology voice: 503-725-3086
> Portland State University fax: 503-725-3888
>
> mailing:
> P.O. Box 751
> Portland, OR 97207
>
> shipping:
> 1719 SW 10th Ave, Room 246
> Portland, OR 97201
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>

-- 
=================================
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch 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 Oct 12 04:26:34 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 11 Oct 2006 - 19:30:09 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.