I have a file .ped who contains several columns, and I want to extract informations from it. 
Here a sample of my data (there is no header):

```
1  1  1 
1  2  1
2  3  2
3  4  1
3  5  2
...

```

The first column indicates the ID family, the second the ID individual, the third the sex of the individual.

I read the table as a dataframe

```
ped <- read.table("pedigree.ped", header=FALSE)

```

How I can compute the number of families exist (one family can appear more than one time and I want to consider them as one)?
I have a sex column where 1 designate male and 2 female, how I can get the distribution of males and females in the data set?

I'm newbie to R, if you can give some code!

Thanks in advanced.