How do you check if expected cell counts are less than 5 when run Fisher's in R? So I have gender (F,M) and blood pressure (Low, High) variables. I have 30, 100, 1, 5 in the observed cells. I understand that you use Fisher's exact test when one or more expected values are less than 5. But how do you check that in R?
I know you use fisher.test() for the testing but I cannot figure out how to find the expected values.. For chi square, chisq()$expected works but it does not work for fisher's
 A: For the chi-squared test the generally-accepted criterion for
the chi-squared statistic to have a chi-squared distribution is that all of the expected counts be at least 5. With support from simulation evidence, many authors allow expected counts to be as small as 3 as long as there are moderately many expected counts and a clear majority are at least 5. 
If there is a question about whether expected counts meet whatever criterion, then the recommendation is to use Fisher's exact test. Because this test uses an exact hypergeometric
distribution, there are no rules to get an acceptable approximation. Expected counts do not play a role, so $exp would not be relevant. 
You say "I understand that you use Fisher's exact test when one or more expected values are less than 5." The idea is that Fisher's test must be used (instead of the chi-squared test) if counts are too small for a good chi-squared approximation. However, there is no requirement for super-small counts in order to use Fisher's test.
Traditionally, Fisher's test was not much used 
in some cases where counts are "too large," owing to the difficulty of computing hypergeometric probabilities. (If factorials are used directly, there can be overflow difficulties.) Careful programming
in R and other software has somewhat relaxed the current meaning of 'too large'. 
Notes: (1) See R documentation on phyper for some notes on computability of hypergeometric distributions.
(2) Example of large counts in R's fisher.test and chisq.test; nearly-matching P-values:
DTA = matrix(c(300,1000,30,60), nrow = 2)
fisher.test(DTA)$p.val
[1] 0.03945529
chisq.test(DTA)$p.val
[1] 0.0372137

(3) Quoted from Wikipedia's (very long) article on the hypergeometric distribution. "As noted above, most modern statistical packages will calculate the significance of Fisher tests, in some cases even where the chi-squared approximation would also be acceptable. The actual computations as performed by statistical software packages will as a rule differ from those described above, because numerical difficulties may result from the large values taken by the factorials. A simple, somewhat better computational approach relies on a gamma function or log-gamma function, but methods for accurate computation of hypergeometric and binomial probabilities remains an active research area."
A: My reading of the Wikipedia article on Fisher's Exact Test suggests the expected values would be the same as they are in the Chi-Squared test. You have 136 samples, six of which exhibit "High" blood pressure so the proportion of the total population who have "High" blood pressure is $\frac{6}{136}$. There are 31 females, so we expect $\frac{6}{136} \cdot 31 \approx 1.4$ "F" in the "High" category. Similarly, there are 105 males, so we expect $\frac{6}{136} \cdot 105 \approx 4.6$ "M" in the "High" category. 
BloodPressure <- 
  matrix(c(30,100,1,5),
nrow = 2,
dimnames = list(Gender = c("Female", "Male"),
                Pressure =c("Low","High")))
fisher.test(BloodPressure)

Output:
     Fisher's Exact Test for Count Data

data:  BloodPressure
p-value = 1
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
  0.1583264 73.2569778
sample estimates:
odds ratio 
  1.495949 

The p-value is 1, so we cannot reject the null hypothesis that there is no difference between "M" and "F" for "High" blood pressure. Indeed, the expected values round to the values you actually observed.
A: We should try to understand "use Fisher's exact test when one or more expected values are less than 5." correctly.  
The process of the development for 2 by 2 frequency table is: Fisher's exact test was found  but it was impossible to calculate when sample size is large. Later, the Pearson chi-square test was used to approximate Fisher's exact test. And although it was proved that when sample size is small. the approximation is not good. So using Pearson chi-square test when sample size is large because Fisher's exact was impossible duo to computation and approximation of the Pearson Chi-square test is acceptable; and using Fisher's chi-square test when sample size is small because it is possible to calculate p-value of Fisher's exact test and the approximation of Pearson Chi-square is too bad. 
So that sentence should be "use Fisher's exact test when calculation is possible; otherwise use Pearson chi-square test if all expected values are less than 5."
We know the difficulty of calculating p-value of Fisher's exact test is history. Current computer and software have no problem to perform Fisher's exact test for a 2 by 2 table given sample size < 10000. So we should use Fisher's exact test without condition. (I did not try sample size >1,000,000.)  
A: To actually answer the question and get the expected counts:
> chisq.test(matrix(c(30,100,1,5), nrow = 2))$expected
          [,1]     [,2]
[1,]  29.63235 1.367647
[2,] 100.36765 4.632353
Warning message:
In chisq.test(matrix(c(30, 100, 1, 5), nrow = 2)) :
  Chi-squared approximation may be incorrect

Next, you really don't need the Fisher's Exact Test (even though I'm quite a fan of that test) because there is a built in randomization test in the chi-square test.  Since this avoids the use of the chi-square distribution, we don't need to worry about the approximation.:
> chisq.test(matrix(c(30,100,1,5), nrow = 2),
+  simulate.p.value=TRUE, B=10000)

    Pearson's Chi-squared test with simulated p-value (based on 10000
    replicates)

data:  matrix(c(30, 100, 1, 5), nrow = 2)
X-squared = 0.13392, df = NA, p-value = 1

Fisher's is also basically a randomization test, but conditioned on row totals and column totals being fixed.  However, for 2x2 tables you don't need to conduct simulations, as the null distribution of cell counts is a known distribution (the hypergeometric distribution).  For other sized Fisher's Exact Tests you can get simulated p-values in the same fashion as in the chi-square test.
