I think you're looking for na.omit. From ?cca:

Choice na.omit <http://127.0.0.1:28773/library/vegan/help/na.omit> removes
all rows with missing values.



On Fri, Feb 19, 2010 at 9:24 PM, L Quinn <lquinn@hotmail.com> wrote:

>
>
> Hello,
>
> I am attempting a cca in vegan with a dataset with missing values in both
> the community dataset and the environmental dataset. I tried entering
> commands for na.omit or na.exclude, but didn't have any luck. Perhaps I'm
> entering them in the wrong format?
>
> #Original problem
> > cca.ind<-cca(ind~.,env)
> Error in na.fail.default(list(DelN = c(2L, NA, NA, NA, 3L, 13L, 7L, NA,  :
>  missing values in object
>
> #First attempt at na.exclude; no different from original problem:
> > cca.ind<-cca(ind~.,env,na.action=na.exclude)
> Error in na.fail.default(list(DelN = c(2L, NA, NA, NA, 3L, 13L, 7L, NA,  :
>  missing values in object
>
> #Second attempt at na.exclude; different error message at least!:
> > cca.ind<-cca(ind~.,env,na.exclude=TRUE)
> Error in model.frame.default(data = env, na.exclude = TRUE, na.action =
> function (object,  :
>  variable lengths differ (found for '(na.exclude)')
>
> A subset of my env dataset:
> > env
>   DelN DelC  R24  GPP   TP  FRP   TN  NOx  NH3  DOC canopy velocity  pH
>  Cond
> 1     2  -44 0.13 0.10 0.01 0.00 0.28 0.01 0.02  6.4 81.904    0.251 5.2
> 138
> 2    NA   NA   NA   NA 0.06 0.01 0.64 0.00 0.02  8.6 91.992    0.000 6.0
> 217
> 3    NA   NA   NA   NA 0.04 0.01 0.32 0.06 0.02  4.9 80.032    0.407 6.4
> 254
> 4    NA   NA   NA   NA 0.07 0.00 0.70 0.00 0.07 21.7 95.528    0.037 5.7
> 273
> 5     3  -34 0.14 0.13 0.11 0.08 0.22 0.01 0.01  3.1 91.888    0.099 7.0
> 395
> 6    13  -40   NA   NA 0.11 0.04 0.35 0.04 0.03  5.7 95.736    0.128 6.8
> 371
> 7     7  -36 0.25 0.34 0.04 0.01 0.36 0.01 0.01  6.3 73.272    0.284 6.2
> 186
> 8    NA   NA   NA   NA 0.04 0.00 0.70 0.00 0.03 14.6 85.336    0.110 6.2
> 203
> 9     8  -33 0.20 0.12 0.08 0.02 0.40 0.09 0.03  3.3 79.096    0.235 6.7
> 357
> 10   NA   NA   NA   NA 0.06 0.01 0.67 0.21 0.06 12.8 93.760    0.075 6.3
> 220
>
> A subset of my "comm" dataset:
>
> >ind
>   NoTaxa PET SIGNAL PONSE OE50 PropAlien  avg_cover  inv_cover  nat_cover
> 27     26   2    3.3    NA   NA        19 0.07594937 0.00000000 0.09836066
> 28     16   2    3.3    24 0.21        16 0.40506329 0.00000000 0.52459016
> 29     15   1    3.1    NA   NA        NA 0.37974684 0.11111111 0.45901639
> 30     18   2    3.6    18 0.23         0 0.40506329 0.27777778 0.44262295
> 31     25   4    3.0    NA   NA        NA 0.51898734 0.00000000 0.67213115
> 32     22   0    3.1    37 0.42        28 0.36708861 0.00000000 0.47540984
> 33     15   0    3.0     9 0.11         0 0.30379747 0.00000000 0.39344262
> 34     17   0    3.0    NA   NA        NA 0.32911392 0.11111111 0.39344262
> 35     16   1    3.0    37 0.45        69 0.27848101 0.11111111 0.32786885
> 36     33   4    3.1    55 0.38        12 0.62025317 0.55555556 0.63934426
>
> Thank you!
>
> Lauren Quinn
>
>
>
>
> _________________________________________________________________
> Hotmail: Free, trusted and rich email service.
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]

