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 -
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
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 -
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 =
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
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
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
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
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
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 -
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)
#
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
12 matches
Mail list logo