[Rd] loading multiple CSV files into a single data frame

oliver oliver at first.in-berlin.de
Thu May 3 23:54:09 CEST 2012


On Thu, May 03, 2012 at 11:40:42PM +0200, victor jimenez wrote:
> First of all, thank you for the answers. I did not know about zoo. However,
> it seems that none approach can do what I exactly want (please, correct me
> if I am wrong).
> 
> Probably, it was not clear in my original question. The CSV files only
> contain the performance values. The other two columns (ASSOC and SIZE) are
> obtained from the existing values in the directory tree. So, in my opinion,
> none of the proposed solutions would work, unless every single "data.csv"
> file contained all the three columns (ASSOC, SIZE and PERF).
[...]

Maybe things will be clearer if you would provide an example
with the tree and some example data, which you provide as a*.zip file.

As I undertand your question, you have a some variables' values
stored in the csv-files, and other values of your variables
are given as directory structure.

So you need to convert the structure of your directory
into values fo your dataframe.

You need to have a dataframe that contains all possible values that are of
interest to you.
Some of them are loaded via the csv-load and others are just picked
from the directory structure.

You just have to fill in the data from the csv into the dataframe,
and the values/variables that are implictly given via the directory structure,
you just set when importing.

Maybe just read in the csv-files and add the missing values.

So if the variable on the cahcing mechanism is
encode as part of the path to the file, e.g. "direct-mapped",
then just set the chace value to "direct-mapped".


Ciao,
   Oliver

P.S.: In my understandiung this would be rather r-users instead of r-devel,
      because I think r-devel seems to be more focussed on internals and
      package stuff, while your problem is rather a user problem
      (any R user needs some kind of "programming" to get things done).



More information about the R-devel mailing list