Skip to content
Prev 284554 / 398502 Next

Writing to a file

Hi

now you omitted data, but never mind :-)
If I remember correctly you want to inspect each row if it contains any of 
"Func" values and how many of them.
structure(list(prot = c(1, 2, 3, 4), X1 = structure(c(1L, 1L, 
1L, 2L), .Label = c("a", " "), class = "factor"), X2 = structure(c(3L, 
2L, 3L, 3L), .Label = c("a", "b", " "), class = "factor"), X3 = 
structure(c(3L, 
3L, 3L, 2L), .Label = c("b", "c", " "), class = "factor"), X4 = 
structure(c(1L, 
1L, 1L, 3L), .Label = c("c", "d", " "), class = "factor"), X5 = 
structure(c(2L, 
1L, 1L, 1L), .Label = c("d", " "), class = "factor")), .Names = c("prot", 
"X1", "X2", "X3", "X4", "X5"), row.names = c(NA, 4L), class = 
"data.frame")
So
1 2 3 4 
1 3 2 1 

gives you number of values (a,b,d) in each row.

Your construction comes from some differnt programming world.

Regards
Petr
http://r.789695.n4.nabble.com/Writing-to-a-
http://www.R-project.org/posting-guide.html