I am having a hard time understanding the contigency table produced by crosstab() between two different rasters. Say the command is

crosstab(r1,r2)
[r1]  [r2]  Count
0     0     3456
1     41    23456
0     41    768
1     42    21
0     42    6

Does this mean that there are 23456 pixels of value=1 in raster 1 that are of value=41 in raster 2, similarly there are 768 pixels of value=0 in raster 1 that have the value=41 in raster 2? Or vice versa i.e. there are 23456 pixels of value 41 in raster 2 that have value=1 in raster 1?

  • Your "vice versa" is the same thing isn't it? "there are 23456 pixels of value=1 in raster 1 that are of value=41 in raster 2" is the same as " there are 23456 pixels of value 41 in raster 2 that have value=1 in raster 1" surely? – Spacedman Aug 4 at 8:57

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.