Re: [R] Permutations of configurations on multiple columns

2011-09-30 Thread Metronome123
Michael Weylandt wrote: > > I'm not entirely sure how these two objects are related. Perhaps give a > little more information on the transform and we can help with > implementation... > Ok, I have got 2 matrices [P,I] and [I,E]. testcontents [P,I]: structure(list(P = structure(c(1L, 1L, 1L, 2L

[R] Permutations of configurations on multiple columns

2011-09-29 Thread Metronome123
Hi, I have got this start situation: structure(list(subject = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L), .Label = c("s1", "s2"), class = "factor"), part = structure(c(1L, 1L, 2L, 3L, 4L, 5L, 1L, 1L, 2L, 6L, 6L), .Label = c("p1", "p2", "p3", "p4", "p5", "p9"), class = "fac

Re: [R] Counting similar rows

2011-09-27 Thread Metronome123
Jean: Thanks! Works great! Lars Op 27 sep. 2011 (w39), om 17:22 heeft Jean V Adams [via R] het volgende geschreven: df <- as.data.frame(unclass(xt)) dfu <- unique(df) class_cnt <- apply(dfu, 1, sum) subject_cnt <- tabulate(match(apply(df, 1, paste, collapse="-"), apply(dfu, 1, pa

[R] Counting similar rows

2011-09-27 Thread Metronome123
Startsituation: structure(c(1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1), .Dim = 4:5, .Dimnames = structure(list(subject = c("s1", "s2", "s3", "s4"), class = c("c1", "c2", "c3", "c4", "c5")), .Names = c("subject", "class")), class = c("xtabs", "table"), call = xtabs(formula = ~s

Re: [R] Newbie question: Converting Table

2011-09-23 Thread Metronome123
Thanks, I will read the posting guide. Q1: thanks for helping me out! Q2: What I mean is that given the dataset: subject1,class1_yes, class2_no, class3_yes, class4_no subject2, class1_no, class2_no, class3_no, class4_yes subject3, class1_yes, class2_no, class3_yes, class4_no I want to count for

[R] Newbie question: Converting Table

2011-09-23 Thread Metronome123
Hi, I'm new to R, and I have searched helpfiles and this forum on my 2 questions. Hope you guys can help me out! :-) Many thanks in advance! Cheers, Lars Q1: I imported a csv file with columnames subject and class. There are about 1000 different classes... It looks like this: subject1, class