Comparing prevalence among sites. Fisher.test and pairwise.t.test I'm studying the prevalence of one parasite on a host from different localities. I do it by assigning presence ("1") or absence ("0") to each host sampled.
After the sampling, I got something like this:
site      <- c("A", "A", "B", "B", "B", "C", "C","A", "A", "B", "B", "B", "C", "C", 
               "A", "A", "B", "B", "B", "C", "C","A", "A", "B", "B", "B", "C", "C")
infection <- c("1", "1", "0", "0", "0", "1", "0", "1", "1", "0", "0", "0", "1", "1", 
               "1", "1", "0", "0", "1", "1", "1", "1", "0", "1", "0", "0", "0", "1")
table1    <- data.frame (site, infection)

I created a data.frame with the data to automatize the process:
library(dplyr)
table.by.site <- ddply(table1, 
                       "site", 
                       summarise,
                       Infected = length(which(infection=="1")),
                       NonInfected = length(which(infection=="0")))
table.by.site

In total, 3 sites and 2 states of infection.  Number of hosts from each site: A= 180; B= 160; C=160.
How can I see if the prevalence of the infections depends on the site of sampling? I have done a fisher.test, finding significant differences:
table.simple <- table.by.site [,-1] #I remove the "site" column.
fisher.test(table.simple)

But how I perform a pairwise t-test? How can I introduce my grouping factor (site)? Should I use a different approach?
EDIT
I will edit the questions instead open a new one.
Let's say I've been collecting samples from 3 different sites (i.e., A, B, and C) in different moments (i.e., week of the year, from 1 to 52). From each of this sampling trips I could obtain a certain number of hosts (e.g. 20 from each). I examined these hosts and I calculate the prevalence (%) of infected hosts per site and trip.
So, the code to generate the table would be something like this:
week      <- c("1","1","2","2","3","3","4","5","5","6","6","6","6","7","8","9",
               "10","11","12","13","14","14","14","15","15","15","16","16","16",
               "16","16","17","17","18","18","18","18","18")
site      <- c("A","A","C","C","B","B","C","B","B","A","A","A","A","B","C","B","C","B",
               "C","A","C","B","B","B","A","A","A","A","C","C","C","C","C","A","A","B",
               "B","B")
infection <- c(1,0,0,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,1,1,0,0,0,0,
               1,1,0,0,0)
table (week)
raw.table <- data.frame (week, site, infection)

Then I calculate the Prevalence of infection for each site and site:
library(plyr)
table.summary <- ddply(raw.table,
                       .(week, site),
                       summarize,
                       Prevalence = ( (sum (infection)*100) / length(infection)))
table.summary

Now, can I use an ANOVA to test the differences in prevalence among sites? Is there any problem because they are percentages?
anova.table <- aov(Prevalence ~ site, data=table.summary)
summary(anova.table)

In the example there is no significant differences among site, but if I want to do a post hoc test, I'd use a pairwise comparison, correcting the p-value with Bonferroni
pairwise.t.test(table.summary$Prevalence, table.summary$site, adj.meth="bonferroni")

Is the whole process correct? Should I take additional steps? Are the percentages a problem for this analysis?
 A: This piece of code, close to your own code, tests if the prevalence across sites is similar:
site      <- c("A", "A", "B", "B", "B", "C", "C","A", "A", "B", "B", "B", "C", "C", 
               "A", "A", "B", "B", "B", "C", "C","A", "A", "B", "B", "B", "C", "C")
infection <- c("1", "1", "0", "0", "0", "1", "0", "1", "1", "0", "0", "0", "1", "1", 
               "1", "1", "0", "0", "1", "1", "1", "1", "0", "1", "0", "0", "0", "1")
data.raw    <- data.frame (site, infection)
data.table <- table(data.raw$site, data.raw$infection)
data.table
fisher.test(data.table)

It should not be necessary to perform t-tests. T tests are generally for testing two continuous variables like length; an ANOVA would be the tool to compare more than two continuous variables. 
The test above could best be compared to an ANOVA, but then your variable is categorical, hence the Fisher's test.
If you want to add post-hoc tests, then you can perform Fisher's exact tests (or chi-square) for each of the site combinations AB, AC, BC. You would need to use a Bonferroni correction. For more information see for example: http://www.biostathandbook.com/fishers.html in the post-hoc section.
