Abstract We propose a method of partitioning the variation in a multivariate set of data according to (i) environmental variables, (ii) variables describing the spatial structure in the data and (iii) temporal variables. This method is an extension of an existing method for partialling out the spatial component of environmental variation, using canonical analysis. Our proposed method extends this approach by including temporal variables in the analysis. Thus, the partitioning of variation for a data matrix of species’abundances or biomass can include, by our methodology, the following components: (1) pure environmental, (2) pure spatial, (3) pure temporal, (4) pure spatial component of environmental, (5) pure temporal component of environmental, (6) pure combined spatial/temporal component, (7) combined spatial/temporal component of environmental and (8) unexplained. In addition, permutation testing accompanying the analyses allows tests of significance for the relationship between the different components and the species data. We illustrate the method with a set of survey data of penaeid species (prawns) obtained on the far northern Great Barrier Reef, Australia. This extension is a useful tool for multivariate analysis of ecological data from surveys, where space, time and environment commonly overlap and are important influences on observed variation.