search for: c_3

Displaying 3 results from an estimated 3 matches for "c_3".

Did you mean: c3
2007 Mar 08
2
sending a vector of characters as arguments for a function
Dear all, It seems to be a recurrent problem to me and I am asking your help to get over it once for all ... My idea is : I have variables C_1, C_2, C_3 ... that corresponds to vectors of size n, and I would like to cbind them. I get a vector of their names using : temp<- ls(pat="C") And I like to find a way to use this vector temp as an argument to cbind. Unfortunately, my various trials failed, here are some samples of what...
2011 Dec 26
1
Finding all triangles in a graph
I have the adjacency matrix of a graph. I'm trying to find all triangles (embeddings of C_3). This doesn't work: index = function(l) seq(l)[l] pairs = do.call(rbind, lapply(seq(nrow(adj)), function(x) cbind(x, index(adj[x,])))) triangles = do.call(rbind, apply(pairs, 1, function(x) cbind(x, index(adj[x[1],] & adj[x[2],])))) I'm absolutely certain I've gone down the wrong...
2009 Nov 09
2
Outputing multilple subsets
...de the original dataset into several subsets and output these multilple datasets. But errors appeared in my loops. See example. ###### a<-c(1:10) b<-c(rep(1,3),rep(2,3),rep(3,4)) c<-data.frame(a,b) #c is the example data num<-c(unique(b)) # I hope to get the subsets c_1.csv,c_2.csv and c_3.csv #Errors for (i in num) { c_num<-c[c$b==num,] write.csv(c_num,file="c:/c_num.csv") } Warning messages: 1: In c$b == num : longer object length is not a multiple of shorter object length 2: In c$b == num : longer object length is not a multiple of shorter object length 3:...