[R] reading data into nested frames

Ulrik Stervbo ulrik.stervbo at gmail.com
Thu Jun 2 21:56:31 CEST 2016


Hi Ed,

I'm not sure I understand, but can't you rwad the files one by one and
create one data.frane using rbind?

Is easy to put do in a loop too.

Best wishes,

Ulrik

On Thu, 2 Jun 2016, 20:23 Ed Siefker, <ebs15242 at gmail.com> wrote:

> I have many data files named like this:
>
> E11.5-021415-dko-1-1-masked-bottom-area.tsv
> E11.5-021415-dko-1-1-masked-top-area.tsv
> E11.5-021415-dko-1-2-masked-bottom-area.tsv
> E11.5-021415-dko-1-2-masked-top-area.tsv
> E11.5-021415-dko-1-3-masked-bottom-area.tsv
> E11.5-021415-dko-1-3-masked-top-area.tsv
>
> age-date-genotype-num-slicenum-filler-position-data
>
> An individual sample is an age-date-geno-num, each sample has two
> parts, and is composed of around 10 slices.  Each row of the tsv is an
> area which will be summed for the total area.
>
> What I want is a dataframe, with a row for each sample and a column
> for bottom and top.  Under bottom and top, I want each element to be a
> dataframe with a row for each slice and a column for the area.
>
> So I can lapply over this list of files, use strsplit to pull out the
> slice num and put the area into the correct row of a dataframe easily
> enough.  But I have a line for every datapoint, not sample, and there
> would be a dataframe for each area.
>
> How can I merge all the data for the slices into one data frame?  Does
> this make sense?
> Thanks
> -Ed
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list