Skip to content

subset with two factors

2 messages · Martin Spindler, Michael Bedward

#
Dear all,

I have a dataframe of the following strucutre

 numacc_b coverage_b Geschlecht GG
1        0          1          W  A
2        0          1          M  A
3        0          1          M  B
4        0          1          M  B
5        0          1          W  A
6        0          1          M  B

I would like to form a subset consisting of all entries with Geschlecht=M and GG=A.

Using
delievers

data frame with 0 columns and 6 rows
delievers

  numacc_b coverage_b Geschlecht GG
2         0          1          M  A
3         0          1          M  B
4         0          1          M  B
6         0          1          M  B
9         0          1          M  B
10        0          1          M  B

But I want to select the dataframe according to both factos.

What can I do?

Thank you answers in advance!

Best,

Martin
#
Hello Martin,

You were almost there :)

T1 <- subset(daten1, Geschlecht=="M" & GG=="A")

Hope this helps.

Michael
On 10 December 2010 22:25, Martin Spindler <Martin.Spindler at gmx.de> wrote: