Commit f78ac521 authored by peguerin's avatar peguerin
Browse files

add underlying data figure S3

parent bc0fffb4
......@@ -16,7 +16,7 @@
##
##########################################################################
## Libraries
lib_vect <-c("raster","plotrix","rgeos","rgdal","sp","maptools","shape","parallel","png","plyr")
lib_vect <-c("sjPlot","gridExtra","visreg","car","ggplot2","MASS","hier.part","raster","plotrix","rgeos","rgdal","sp","maptools","shape","parallel","png","plyr")
sapply(lib_vect,library,character.only=TRUE)
......@@ -101,17 +101,36 @@ environment=c(rep("marine",dim(Mr)[1]),rep("freshwater",dim(Fr)[1]))
Tr=cbind(Tr,environment)
Tr$environment <- factor(Tr$environment,levels = c('marine','freshwater'),ordered = TRUE)
## latclass
dat=read.table("14-tables/latclass.tsv",header=T)
##########################################################################
## load worldcoast shapefile
grid <- readOGR("01-infos/grid_equalarea200km","gridFish.b_260418")
##########################################################################
## model to compare genetic diversity bewteen marine and FW species
mod1<-lm(scale(log(GD_mean))~is_marine+latitude,data=dat)
## model to compare species diversity bewteen marine and FW species
mod2<-lm(scale(log(richness))~is_marine+latitude,data=dat)
summary(mod1)
summary(mod2)
##########################################################################
## dataframe of genetic diversity by latband
dcM.lb=latbandrichness(Mr,grid)
dcF.lb=latbandrichness(Fr,grid)
##########################################################################
##write tables
write.table(Tr,"14-tables/figure_S3a_underlying_data.tsv",col.names=T,row.names=F,sep="\t")
write.table(dcM.lb,"14-tables/figure_S3b_underlying_data.tsv",col.names=T,row.names=F,sep="\t")
write.table(dcF.lb,"14-tables/figure_S3c_underlying_data.tsv",col.names=T,row.names=F,sep="\t")
##########################################################################
## write pdf files
......
"cell" "richness" "environment"
3 17.9333333333333 "marine"
86 184.25 "marine"
140 125.5 "marine"
150 8.6 "marine"
172 553.5 "marine"
214 135 "marine"
217 202 "marine"
220 23.5 "marine"
288 160.666666666667 "marine"
289 47 "marine"
293 39.875 "marine"
362 169.333333333333 "marine"
363 106 "marine"
367 69.25 "marine"
440 132.625 "marine"
441 88.25 "marine"
442 48.3 "marine"
513 125.333333333333 "marine"
514 119.5 "marine"
515 77.875 "marine"
516 53.7 "marine"
517 8.57142857142857 "marine"
588 48.625 "marine"
590 57 "marine"
591 8 "marine"
662 28.75 "marine"
664 51.3 "marine"
690 294.5 "marine"
733 297.75 "marine"
738 43.3 "marine"
791 1055.5 "marine"
808 178.166666666667 "marine"
812 39.6 "marine"
863 488.5 "marine"
864 1103.5 "marine"
882 167.666666666667 "marine"
886 19.4 "marine"
960 21.3 "marine"
1030 247.555555555556 "marine"
1031 157.555555555556 "marine"
1034 24.0666666666667 "marine"
1062 764.5 "marine"
1063 546.5 "marine"
1067 139 "marine"
1105 138.333333333333 "marine"
1108 20.8 "marine"
1138 700.25 "marine"
1256 22.7 "marine"
1437 669 "marine"
1622 149.166666666667 "marine"
1768 239.833333333333 "marine"
1769 166.5 "marine"
1841 213.25 "marine"
1842 291.166666666667 "marine"
1915 268.25 "marine"
1916 63.8333333333333 "marine"
1985 271.5 "marine"
1986 293 "marine"
1987 291 "marine"
1988 346.666666666667 "marine"
1989 204.25 "marine"
2057 392.166666666667 "marine"
2058 210.666666666667 "marine"
2062 86.6666666666667 "marine"
2063 66.5 "marine"
2130 638 "marine"
2203 748.75 "marine"
2204 189 "marine"
2277 244 "marine"
2493 484.5 "marine"
2494 529 "marine"
2495 1003.25 "marine"
2537 84.5 "marine"
2560 205 "marine"
3103 68.6666666666667 "marine"
3145 613.5 "marine"
3218 487 "marine"
3219 629 "marine"
3238 271.5 "marine"
3297 403.5 "marine"
3303 968 "marine"
3304 1645.5 "marine"
3305 1063 "marine"
3306 366.75 "marine"
3307 1340 "marine"
3312 648.75 "marine"
3368 117.5 "marine"
3374 1180.25 "marine"
3380 701.5 "marine"
3381 1405 "marine"
3385 1208.5 "marine"
3386 309 "marine"
3447 811.5 "marine"
3448 876 "marine"
3449 921.5 "marine"
3511 273 "marine"
3512 197.5 "marine"
3529 1689 "marine"
3530 844.25 "marine"
3531 1087.25 "marine"
3569 173.75 "marine"
3605 1749.5 "marine"
3606 1550.75 "marine"
3655 453.5 "marine"
3656 332.25 "marine"
3669 904.5 "marine"
3679 1292.5 "marine"
3752 1573.25 "marine"
3758 1042.5 "marine"
3759 938.25 "marine"
3760 537.75 "marine"
3782 38.8333333333333 "marine"
3787 66.25 "marine"
3789 92.75 "marine"
3834 809 "marine"
3835 526.5 "marine"
3865 202.75 "marine"
3867 133 "marine"
3873 184.5 "marine"
3899 1352.5 "marine"
3929 78.75 "marine"
3967 833 "marine"
3983 789 "marine"
3984 700.5 "marine"
4007 49 "marine"
4040 619.333333333333 "marine"
4044 421 "marine"
4045 803.666666666667 "marine"
4057 687 "marine"
4058 685.833333333333 "marine"
4059 372.166666666667 "marine"
4061 140.166666666667 "marine"
4077 88.75 "marine"
4081 145.25 "marine"
4082 121.75 "marine"
4083 137 "marine"
4114 318.5 "marine"
4119 1340 "marine"
4132 662.5 "marine"
4133 161.75 "marine"
4134 158.333333333333 "marine"
4135 218.5 "marine"
4156 164.75 "marine"
4188 877.25 "marine"
4193 1068.25 "marine"
4206 565.75 "marine"
4207 452.5 "marine"
4208 362.666666666667 "marine"
4209 304.5 "marine"
4223 59.125 "marine"
4228 120.333333333333 "marine"
4229 162 "marine"
4230 190 "marine"
4232 154.25 "marine"
4262 1139.75 "marine"
4265 910.75 "marine"
4279 123.5 "marine"
4280 429.5 "marine"
4281 616 "marine"
4282 270.333333333333 "marine"
4297 60.5 "marine"
4338 324 "marine"
4354 228.25 "marine"
4355 624.5 "marine"
4371 78.25 "marine"
4380 239.25 "marine"
4381 439.25 "marine"
4436 84.5 "marine"
4456 689.5 "marine"
4503 471.25 "marine"
4507 220.25 "marine"
4577 507 "marine"
4578 247 "marine"
4579 325.75 "marine"
4726 419.166666666667 "marine"
4741 63.375 "marine"
4800 437.333333333333 "marine"
4892 66.8333333333333 "marine"
4953 131 "marine"
4982 332.75 "marine"
5028 105 "marine"
5040 55.5555555555556 "marine"
5060 256 "marine"
5061 292 "marine"
5139 155 "marine"
5173 224.75 "marine"
5246 156.833333333333 "marine"
5250 79.125 "marine"
5289 100 "marine"
5296 92.5 "marine"
5320 198.833333333333 "marine"
5389 458.75 "marine"
5390 343 "marine"
5392 182.666666666667 "marine"
5393 233.5 "marine"
5394 197.166666666667 "marine"
5463 408.5 "marine"
5464 254.5 "marine"
5536 455.25 "marine"
5548 5.4 "marine"
5696 20.4 "marine"
5697 0.714285714285714 "marine"
5809 84.25 "marine"
5829 442.75 "marine"
5844 16.6 "marine"
5845 11.7857142857143 "marine"
5900 691.5 "marine"
5912 264.666666666667 "marine"
5947 60.25 "marine"
5954 73.5 "marine"
5955 72 "marine"
5986 344.166666666667 "marine"
5993 13.8571428571429 "marine"
6059 383 "marine"
6124 174.833333333333 "marine"
6127 318 "marine"
6128 299.5 "marine"
6129 383 "marine"
6130 241.166666666667 "marine"
6133 361.333333333333 "marine"
6141 12.1428571428571 "marine"
6200 220 "marine"
6201 342 "marine"
6207 299.25 "marine"
6275 155.75 "marine"
6281 271 "marine"
6282 87.8333333333333 "marine"
6283 187 "marine"
6289 5.21428571428571 "marine"
6312 7 "marine"
6354 142.166666666667 "marine"
6383 23.5 "marine"
6424 180.75 "marine"
6429 115.25 "marine"
6431 142.25 "marine"
6432 155.333333333333 "marine"
6433 147.333333333333 "marine"
6499 383.75 "marine"
6503 52.75 "marine"
6505 191.5 "marine"
6506 146.833333333333 "marine"
6507 125.666666666667 "marine"
6574 188.75 "marine"
6579 187.5 "marine"
6580 152.833333333333 "marine"
6581 117.666666666667 "marine"
6645 183.25 "marine"
6647 118.25 "marine"
6653 194 "marine"
6654 177.333333333333 "marine"
6675 36.5 "marine"
6719 190 "marine"
6727 198.25 "marine"
6796 297.5 "marine"
6797 186.75 "marine"
6803 36.3333333333333 "marine"
6870 89.5 "marine"
6875 99.5 "marine"
6876 143.666666666667 "marine"
6877 35.8333333333333 "marine"
6901 288 "marine"
6941 367.25 "marine"
6943 219.5 "marine"
6944 82 "marine"
6945 221.75 "marine"
6949 146.25 "marine"
6974 482.25 "marine"
6975 470.75 "marine"
7015 208.75 "marine"
7016 193.75 "marine"
7017 93.5 "marine"
7018 248.25 "marine"
7019 75.75 "marine"
7047 493.75 "marine"
7088 94.75 "marine"
7092 226.5 "marine"
7099 46.8333333333333 "marine"
7120 801.833333333333 "marine"
7164 302 "marine"
7165 131.5 "marine"
7166 49 "marine"
7193 330.75 "marine"
7194 832 "marine"
7236 95.75 "marine"
7237 233.75 "marine"
7239 73 "marine"
7269 265 "marine"
7312 233.25 "marine"
7313 145 "marine"
7343 584 "marine"
7385 234 "marine"
7386 220.25 "marine"
7387 71 "marine"
7417 844.75 "marine"
7459 213.75 "marine"
7461 57 "marine"
7492 814.75 "marine"
7493 519.5 "marine"
7533 116.75 "marine"
7567 1215 "marine"
7568 780 "marine"
7569 990.25 "marine"
7644 463.75 "marine"
7679 247 "marine"
7681 124 "marine"
7684 68.25 "marine"
8095 1848.33333333333 "marine"
8169 1023.5 "marine"
8342 302.5 "marine"
8386 1524.5 "marine"
8396 1842.5 "marine"
8818 45 "marine"
8858 1070.5 "marine"
8890 104.166666666667 "marine"
8930 1329.75 "marine"
8931 742 "marine"
8962 75 "marine"
8963 110 "marine"
8998 955.25 "marine"
9003 1835 "marine"
9036 76.8333333333333 "marine"
9037 106 "marine"
9077 931 "marine"
9110 76.2222222222222 "marine"
9145 923.333333333333 "marine"
9146 838 "marine"
9219 1164.5 "marine"
9275 98 "marine"
9293 2306 "marine"
9372 1014 "marine"
9446 642.5 "marine"
9738 2072.75 "marine"
9739 2273.25 "marine"
9882 506.75 "marine"
9958 1851.5 "marine"
10029 2354.5 "marine"
10030 1250.75 "marine"
10031 1256.5 "marine"
10102 605 "marine"
10105 1213.5 "marine"
10169 399.5 "marine"
10176 1476.83333333333 "marine"
10245 615.5 "marine"
10256 1266.25 "marine"
10318 2762 "marine"
10334 2224 "marine"
10335 1191 "marine"
10336 1569.75 "marine"
10398 523.5 "marine"
10408 3016 "marine"
10409 2037.5 "marine"
10410 2211 "marine"
10438 35.6666666666667 "marine"
10455 1780.5 "marine"
10474 1721.5 "marine"
10481 2521.75 "marine"
10482 1586.5 "marine"
10483 791.5 "marine"
10484 1976.5 "marine"
10526 709.25 "marine"
10533 1900.5 "marine"
10540 2849.5 "marine"
10549 2573.5 "marine"
10550 2262.25 "marine"
10607 2142.5 "marine"
10614 2893.5 "marine"
10622 631 "marine"
10624 2055.5 "marine"
10634 2053.5 "marine"
10696 2162.5 "marine"
10700 2341.5 "marine"
10702 1712 "marine"
10707 2737.5 "marine"
10758 2377.25 "marine"
10774 3545.25 "marine"
10776 1804.5 "marine"
10777 751.5 "marine"
10779 1458.75 "marine"
10781 2772 "marine"
10783 2979.5 "marine"
10848 873 "marine"
10924 944 "marine"
11006 1536.25 "marine"
11062 1304 "marine"
11063 2455.5 "marine"
11083 1575.5 "marine"
11088 19.25 "marine"
11139 985.5 "marine"
11141 472 "marine"
11157 980.75 "marine"
11162 59.25 "marine"
11210 784.666666666667 "marine"
11211 1132 "marine"
11216 973.5 "marine"
11217 520.333333333333 "marine"
11231 707.166666666667 "marine"
11235 90 "marine"
11306 232.25 "marine"
11380 531.25 "marine"
11386 41.3333333333333 "marine"
11400 48.6666666666667 "marine"
11401 12.375 "marine"
11425 2386 "marine"
11454 851.75 "marine"
11455 640.25 "marine"
11474 45.1666666666667 "marine"
11501 1391.75 "marine"
11536 7.66666666666667 "marine"
11547 7.5 "marine"
11548 39.5 "marine"
11557 443.25 "marine"
11575 3254 "marine"
11630 244.75 "marine"
11632 718.75 "marine"
11643 712.5 "marine"
11645 2716.5 "marine"
11646 1937.5 "marine"
11704 330.5 "marine"
11706 579.5 "marine"
11717 2247.25 "marine"
11718 2774.5 "marine"
11759 18 "marine"
11781 685.25 "marine"
11789 1199.5 "marine"
11857 1048.25 "marine"
11862 1785.5 "marine"
11875 1801.25 "marine"
11904 82.8333333333333 "marine"
12005 491 "marine"
12007 466 "marine"
12054 70.1666666666667 "marine"
12069 56 "marine"
12070 56.1666666666667 "marine"
12131 20.3333333333333 "marine"
12286 19.7 "marine"
12359 3.65384615384615 "marine"
12360 33.4 "marine"
12425 89.5 "marine"
12434 40.3 "marine"
12509 31.6 "marine"
12572 77 "marine"
12582 53.8 "marine"
12646 103.833333333333 "marine"
12647 17.25 "marine"
12649 33.8333333333333 "marine"
12652 14.5 "marine"
12656 46.6 "marine"
12723 20.1666666666667 "marine"
12730 36.7 "marine"
12754 930.5 "marine"
12797 18.3333333333333 "marine"
12798 14.875 "marine"
12800 12.2 "marine"
12871 23.1666666666667 "marine"
12872 26 "marine"
2060 92.6666666666667 "freshwater"
2062 76.3333333333333 "freshwater"
2133 78.25 "freshwater"
2205 56.5 "freshwater"
2208 96.75 "freshwater"
2356 124.5 "freshwater"
2649 341 "freshwater"
2717 104 "freshwater"
2721 209.25 "freshwater"
2787 81 "freshwater"
2792 200 "freshwater"
2800 502 "freshwater"
2863 178 "freshwater"
2864 77.25 "freshwater"
2865 217 "freshwater"
2867 208 "freshwater"
2874 502 "freshwater"
2936 177.5 "freshwater"
2937 125 "freshwater"
2938 150.5 "freshwater"
2942 143.25 "freshwater"
3009 173.75 "freshwater"
3017 175.5 "freshwater"
3018 354 "freshwater"
3019 502 "freshwater"
3020 502 "freshwater"
3022 502 "freshwater"
3090 154.333333333333 "freshwater"
3091 298 "freshwater"
3092 457.5 "freshwater"
3093 502 "freshwater"
3094 502 "freshwater"
3103 10.2222222222222 "freshwater"
3164 435.25 "freshwater"
3165 507.5 "freshwater"
3166 502 "freshwater"
3167 502 "freshwater"
3168 502 "freshwater"
3169 502 "freshwater"
3170 502 "freshwater"
3171 502 "freshwater"
3172 324 "freshwater"
3229 188 "freshwater"
3238 240.25 "freshwater"
3239 463.75 "freshwater"
3240 532.5 "freshwater"
3241 502 "freshwater"
3242 502 "freshwater"
3243 502 "freshwater"
3244 502 "freshwater"
3245 521.5 "freshwater"
3246 316.5 "freshwater"
3305 28.25 "freshwater"
3312 180.25 "freshwater"
3313 250.75 "freshwater"
3314 547.75 "freshwater"
3315 502 "freshwater"
3316 502 "freshwater"
3317 515 "freshwater"
3318 447.75 "freshwater"
3319 287.25 "freshwater"
3320 207 "freshwater"
3386 149 "freshwater"
3387 270.25 "freshwater"
3388 491 "freshwater"
3389 502 "freshwater"
3390 502 "freshwater"
3391 515 "freshwater"
3460 115 "freshwater"
3461 163 "freshwater"
3462 416.75 "freshwater"
3463 502 "freshwater"
3464 502 "freshwater"
3465 521.5 "freshwater"
3466 207 "freshwater"
3531 46.5 "freshwater"
3533 126.5 "freshwater"
3534 132 "freshwater"
3536 262.75 "freshwater"
3537 538.5 "freshwater"
3539 515 "freshwater"
3540 287.25 "freshwater"
3541 207 "freshwater"
3542 207.666666666667 "freshwater"
3610 156.25 "freshwater"
3611 267 "freshwater"
3612 436.75 "freshwater"
3613 510 "freshwater"
3614 369.75 "freshwater"
3615 207 "freshwater"
3616 207.333333333333 "freshwater"
3685 149.5 "freshwater"
3686 126 "freshwater"
3689 207 "freshwater"
3732 2273 "freshwater"
3738 2476.5 "freshwater"
3761 145.5 "freshwater"
3763 212 "freshwater"
3764 207 "freshwater"
3809 2273 "freshwater"
3814 1288 "freshwater"
3818 302.5 "freshwater"
3836 191.5 "freshwater"
3837 216.5 "freshwater"
3838 207 "freshwater"
3912 207.166666666667 "freshwater"
3956 2273 "freshwater"
3957 2273 "freshwater"
3961 1895.5 "freshwater"
4027 2273 "freshwater"
4028 2273 "freshwater"
4033 2273 "freshwater"
4060 49.3333333333333 "freshwater"
4101 2273 "freshwater"
4105 2273 "freshwater"
4107 2273 "freshwater"
4158 31 "freshwater"
4170 2273 "freshwater"
4232 6 "freshwater"
4233 46.25 "freshwater"
4234 552.5 "freshwater"
4235 1048.5 "freshwater"
4251 2273 "freshwater"
4253 2273 "freshwater"
4254 2273 "freshwater"
4257 2345.5 "freshwater"
4308 318 "freshwater"
4309 699.25 "freshwater"
4312 1047 "freshwater"
4319 1523.75 "freshwater"
4320 2954 "freshwater"
4381 11 "freshwater"
4391 1047 "freshwater"
4393 1047 "freshwater"
4394 2477.25 "freshwater"
4400 2273 "freshwater"