Pearson's chi square goodness of fit test - using R

Pearson's chi square goodness of fit test

Gives something like this:

> chisq.test(x, p=y/sum(x), simulate.p.value=TRUE)
Chi-squared test for given probabilities with simulated p-value (based
on 2000 replicates)
data: x
X-squared = 293.4632, df = NA, p-value = 0.0004998