Re: [R] how to combine data of several csv-files

2007-07-31 Thread Antje
Hi Jim, that's exactly what I'm looking for. Thank you so much. I think, I should look for some further documentation on list handling. Many thanks also to [EMAIL PROTECTED] ;) for spending time in finding a solution... Have a nice day! Antje jim holtman schrieb: This should do it: v1 -

Re: [R] how to combine data of several csv-files

2007-07-31 Thread 8rino-Luca Pantani
Hi Jim, that's exactly what I'm looking for. Thank you so much. I think, I should look for some further documentation on list handling. I think I will do the same... Thanks to Jim I learned textConnection and rowMeans. Jim, could you please go a step further and tell me how to

Re: [R] how to combine data of several csv-files

2007-07-31 Thread jim holtman
Here is the modified script for computing the 'sd': v1 - NA v2 - rnorm(6) v3 - rnorm(6) v4 - rnorm(6) v5 - rnorm(6) v6 - rnorm(6) v7 - rnorm(6) v8 - rnorm(6) v8 - NA list - list(v1,v2,v3,v4,v5,v6,v7,v8) categ - c(NA,cat1,cat1,cat1,cat2,cat2,cat2,NA) # create partitioned list list.cat -

Re: [R] how to combine data of several csv-files

2007-07-31 Thread Antje
Hey, I had the same question concerning the sd calculation and I got the following solution: list - split(list, class_vec) list - lapply(list, function(x) do.call('rbind', x)) my.mean - lapply(ret, FUN = function(x) { t - as.matrix(x) rm - as.matrix(apply( t, 1, FUN =

[R] how to combine data of several csv-files

2007-07-30 Thread Antje
Hello, I'm looking for a solution for the following problem: 1) I have a folder with several csv files; each contains a set of measurement values 2) The measurements of each file belong to a position in a two dimensional matrix (lets say B02.csv belongs to position 2,2 3) The size of the

Re: [R] how to combine data of several csv-files

2007-07-30 Thread Antje
Hello, sorry for this confusion but I don't know a better way to explain... I have no problems to read in the files and to process them. I end up with a list of results like this: ret $A02.csv [1] NA $B02.csv [1] 89.130435 8.695652 2.173913 0.00 0.00 0.00 9.892473 $C02.csv

Re: [R] how to combine data of several csv-files

2007-07-30 Thread Antje
okay, I played a bit around and now I have some kind of testcase for you: v1 - NA v2 - rnorm(6) v3 - rnorm(6) v4 - rnorm(6) v5 - rnorm(6) v6 - rnorm(6) v7 - rnorm(6) v8 - rnorm(6) v8 - NA list - list(v1,v2,v3,v4,v5,v6,v7,v8) categ - c(NA,cat1,cat1,cat1,cat2,cat2,cat2,NA) list [[1]] [1] NA

Re: [R] how to combine data of several csv-files

2007-07-30 Thread niederlein-rstat
okay, I played a bit around and now I have some kind of testcase for you: v1 - NA v2 - rnorm(6) v3 - rnorm(6) v4 - rnorm(6) v5 - rnorm(6) v6 - rnorm(6) v7 - rnorm(6) v8 - rnorm(6) v8 - NA list - list(v1,v2,v3,v4,v5,v6,v7,v8) categ - c(NA,cat1,cat1,cat1,cat2,cat2,cat2,NA) list [[1]] [1] NA

Re: [R] how to combine data of several csv-files

2007-07-30 Thread Antje
Hello, thank you for your help. But I guess, it's still not what I want... printing df.my gives me df.my v1 v2 v3 v4 v5 v6 v7 v8 1 NA -0.6442149 0.02354036 -1.40362589 -1.1829260 1.17099178 -0.046778203 NA 2 NA -0.2047012 -1.36186952

Re: [R] how to combine data of several csv-files

2007-07-30 Thread 8rino-Luca Pantani
Ok. I missed the grouping factor Try this. You can modify my factor to fit your needs. As to avoid list, I cannot help, sorry I use them only when I have to collect different classes of objects. v1 - NA v2 - rnorm(6) v3 - rnorm(6) v4 - rnorm(6) v5 - rnorm(6) v6 - rnorm(6) v7 - rnorm(6) v8 -

Re: [R] how to combine data of several csv-files

2007-07-30 Thread jim holtman
This should do it: v1 - NA v2 - rnorm(6) v3 - rnorm(6) v4 - rnorm(6) v5 - rnorm(6) v6 - rnorm(6) v7 - rnorm(6) v8 - rnorm(6) v8 - NA list - list(v1,v2,v3,v4,v5,v6,v7,v8) categ - c(NA,cat1,cat1,cat1,cat2,cat2,cat2,NA) # create partitioned list list.cat - split(list, categ) #

Re: [R] how to combine data of several csv-files

2007-07-30 Thread jim holtman
Is this what you want: x - read.table(textConnection( v1 v2 v3 v4 v5 v6 v7 v8 + 1 NA -0.6442149 0.02354036 -1.40362589 -1.1829260 1.17099178 -0.046778203 NA + 2 NA -0.2047012 -1.36186952 0.13045724 2.1411553 0.49248118 -0.233788840 NA