I think I'm just too tired to see the mistake. I wrote a function to get the maximal value for two data sets from a 'for' loop:
plot_zu <- function(x) {for (i in 1:x){
z=data_raw[grep(a[i], data_raw$Gene.names),]
b=data_raw_ace[grep(a[i], data_raw_ace$Gene.names),]
p<-vector("numeric", length(1:length(a)))
p[i]<-max(z$t_test_diff)
return(p)}
}
Imagine: a is a vector of names and the data set (data_raw(_ace))
is filtered by it. In the end, I would like to have all maxima values of column t_test_diff
in a vector. After that I want to add the t_test_diff
column values from data_raw_ace also.
So the problem is, that I get this:
[1] 1.210213 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
[8] 0.000000 0.000000
So there is a problem with brackets or something but I cannot see it ( first value fits). Sorry for no good example but i think it is understandable and an easy to solve question.
If need be, I can add another example.
Thanks a lot!!
gratefully,
Hendrik