[R] reading data into nested frames

Ed Siefker ebs15242 at gmail.com
Thu Jun 2 20:22:11 CEST 2016


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



More information about the R-help mailing list