-
Notifications
You must be signed in to change notification settings - Fork 31
/
math_stat_analysis.R
3038 lines (2858 loc) · 147 KB
/
math_stat_analysis.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#' @title And
#'
#' @description Performs a logical AND operator on two Boolean raster images.
#'
#' @param input1 Input raster file.
#' @param input2 Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_and <- function(input1, input2, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input1=", wbt_file_path(input1)))
args <- paste(args, paste0("--input2=", wbt_file_path(input2)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "and"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Not
#'
#' @description Performs a logical NOT operator on two Boolean raster images.
#'
#' @param input1 Input raster file.
#' @param input2 Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_not <- function(input1, input2, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input1=", wbt_file_path(input1)))
args <- paste(args, paste0("--input2=", wbt_file_path(input2)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "not"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Or
#'
#' @description Performs a logical OR operator on two Boolean raster images.
#'
#' @param input1 Input raster file.
#' @param input2 Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_or <- function(input1, input2, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input1=", wbt_file_path(input1)))
args <- paste(args, paste0("--input2=", wbt_file_path(input2)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "or"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Absolute value
#'
#' @description Calculates the absolute value of every cell in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_absolute_value <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "absolute_value"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Add
#'
#' @description Performs an addition operation on two rasters or a raster and a constant value.
#'
#' @param input1 Input raster file or constant value.
#' @param input2 Input raster file or constant value.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_add <- function(input1, input2, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input1=", wbt_file_path(input1)))
args <- paste(args, paste0("--input2=", wbt_file_path(input2)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "add"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Anova
#'
#' @description Performs an analysis of variance (ANOVA) test on a raster dataset.
#'
#' @param input Input raster file.
#' @param features Feature definition (or class) raster.
#' @param output Output HTML file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_anova <- function(input, features, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--features=", wbt_file_path(features)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "anova"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Arc cos
#'
#' @description Returns the inverse cosine (arccos) of each values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_arc_cos <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "arc_cos"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Arc sin
#'
#' @description Returns the inverse sine (arcsin) of each values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_arc_sin <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "arc_sin"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Arc tan
#'
#' @description Returns the inverse tangent (arctan) of each values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_arc_tan <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "arc_tan"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Arcosh
#'
#' @description Returns the inverse hyperbolic cosine (arcosh) of each values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_arcosh <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "arcosh"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Arsinh
#'
#' @description Returns the inverse hyperbolic sine (arsinh) of each values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_arsinh <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "arsinh"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Artanh
#'
#' @description Returns the inverse hyperbolic tangent (arctanh) of each values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_artanh <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "artanh"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Atan2
#'
#' @description Returns the 2-argument inverse tangent (atan2).
#'
#' @param input_y Input y raster file or constant value (rise).
#' @param input_x Input x raster file or constant value (run).
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_atan2 <- function(input_y, input_x, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input_y=", wbt_file_path(input_y)))
args <- paste(args, paste0("--input_x=", wbt_file_path(input_x)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "atan2"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Attribute correlation
#'
#' @description Performs a correlation analysis on attribute fields from a vector database.
#'
#' @param input Input vector file.
#' @param output Output HTML file (default name will be based on input file if unspecified).
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_attribute_correlation <- function(input, output=NULL, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
if (!is.null(output)) {
args <- paste(args, paste0("--output=", wbt_file_path(output)))
}
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "attribute_correlation"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Attribute correlation neighbourhood analysis
#'
#' @description Performs a correlation on two input vector attributes within a neighbourhood search windows.
#'
#' @param input Input vector file.
#' @param field1 First input field name (dependent variable) in attribute table.
#' @param field2 Second input field name (independent variable) in attribute table.
#' @param radius Search Radius (in map units).
#' @param min_points Minimum number of points.
#' @param stat Correlation type; one of 'pearson' (default) and 'spearman'.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_attribute_correlation_neighbourhood_analysis <- function(input, field1, field2, radius=NULL, min_points=NULL, stat="pearson", wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--field1=", wbt_file_path(field1)))
args <- paste(args, paste0("--field2=", wbt_file_path(field2)))
if (!is.null(radius)) {
args <- paste(args, paste0("--radius=", radius))
}
if (!is.null(min_points)) {
args <- paste(args, paste0("--min_points=", min_points))
}
if (!is.null(stat)) {
args <- paste(args, paste0("--stat=", stat))
}
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "attribute_correlation_neighbourhood_analysis"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Attribute histogram
#'
#' @description Creates a histogram for the field values of a vector's attribute table.
#'
#' @param input Input vector file.
#' @param field Input field name in attribute table.
#' @param output Output HTML file (default name will be based on input file if unspecified).
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_attribute_histogram <- function(input, field, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--field=", wbt_file_path(field)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "attribute_histogram"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Attribute scattergram
#'
#' @description Creates a scattergram for two field values of a vector's attribute table.
#'
#' @param input Input raster file.
#' @param fieldx Input field name in attribute table for the x-axis.
#' @param fieldy Input field name in attribute table for the y-axis.
#' @param output Output HTML file (default name will be based on input file if unspecified).
#' @param trendline Draw the trendline.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_attribute_scattergram <- function(input, fieldx, fieldy, output, trendline=FALSE, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--fieldx=", wbt_file_path(fieldx)))
args <- paste(args, paste0("--fieldy=", wbt_file_path(fieldy)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (trendline) {
args <- paste(args, "--trendline")
}
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "attribute_scattergram"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Ceil
#'
#' @description Returns the smallest (closest to negative infinity) value that is greater than or equal to the values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_ceil <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "ceil"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Conditional evaluation
#'
#' @description Performs a conditional evaluation (if-then-else) operation on a raster.
#'
#' @param input Name of the input raster file.
#' @param statement Conditional statement e.g. value > 35.0. This statement must be a valid Rust statement.
#' @param true Value where condition evaluates TRUE (input raster or constant value).
#' @param false Value where condition evaluates FALSE (input raster or constant value).
#' @param output Name of the output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_conditional_evaluation <- function(input, output, statement="", true=NULL, false=NULL, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!is.null(statement)) {
args <- paste(args, paste0("--statement=", statement))
}
if (!is.null(true)) {
args <- paste(args, paste0("--true=", true))
}
if (!is.null(false)) {
args <- paste(args, paste0("--false=", false))
}
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "conditional_evaluation"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Conditioned latin hypercube
#'
#' @description Implements conditioned Latin Hypercube sampling.
#'
#' @param inputs Name of the input raster file.
#' @param output Output shapefile.
#' @param samples Number of sample sites returned.
#' @param iterations Maximum iterations (if stopping criteria not reached).
#' @param seed Seed for RNG consistency.
#' @param prob Probability of random resample or resampling worst strata between `[0,1]`.
#' @param threshold Objective function values below the theshold stop the resampling iterations.
#' @param temp Initial annealing temperature between `[0,1]`.
#' @param temp_decay Annealing temperature decay proportion between `[0,1]`. Reduce temperature by this proportion each annealing cycle.
#' @param cycle Number of iterations before decaying annealing temperature.
#' @param average Weight the continuous objective funtion by the 1/N contributing strata.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_conditioned_latin_hypercube <- function(inputs, output, samples=500, iterations=25000, seed=NULL, prob=0.5, threshold=NULL, temp=1.0, temp_decay=0.05, cycle=10, average=FALSE, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--inputs=", wbt_file_path(inputs)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!is.null(samples)) {
args <- paste(args, paste0("--samples=", samples))
}
if (!is.null(iterations)) {
args <- paste(args, paste0("--iterations=", iterations))
}
if (!is.null(seed)) {
args <- paste(args, paste0("--seed=", seed))
}
if (!is.null(prob)) {
args <- paste(args, paste0("--prob=", prob))
}
if (!is.null(threshold)) {
args <- paste(args, paste0("--threshold=", threshold))
}
if (!is.null(temp)) {
args <- paste(args, paste0("--temp=", temp))
}
if (!is.null(temp_decay)) {
args <- paste(args, paste0("--temp_decay=", temp_decay))
}
if (!is.null(cycle)) {
args <- paste(args, paste0("--cycle=", cycle))
}
if (average) {
args <- paste(args, "--average")
}
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "conditioned_latin_hypercube"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Cos
#'
#' @description Returns the cosine (cos) of each values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_cos <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "cos"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Cosh
#'
#' @description Returns the hyperbolic cosine (cosh) of each values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_cosh <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "cosh"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Crispness index
#'
#' @description Calculates the Crispness Index, which is used to quantify how crisp (or conversely how fuzzy) a probability image is.
#'
#' @param input Input raster file.
#' @param output Optional output html file (default name will be based on input file if unspecified).
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_crispness_index <- function(input, output=NULL, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
if (!is.null(output)) {
args <- paste(args, paste0("--output=", wbt_file_path(output)))
}
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "crispness_index"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Cross tabulation
#'
#' @description Performs a cross-tabulation on two categorical images.
#'
#' @param input1 Input raster file 1.
#' @param input2 Input raster file 1.
#' @param output Output HTML file (default name will be based on input file if unspecified).
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_cross_tabulation <- function(input1, input2, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input1=", wbt_file_path(input1)))
args <- paste(args, paste0("--input2=", wbt_file_path(input2)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "cross_tabulation"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Cumulative distribution
#'
#' @description Converts a raster image to its cumulative distribution function.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_cumulative_distribution <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "cumulative_distribution"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Decrement
#'
#' @description Decreases the values of each grid cell in an input raster by 1.0 (see also InPlaceSubtract).
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_decrement <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "decrement"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Divide
#'
#' @description Performs a division operation on two rasters or a raster and a constant value.
#'
#' @param input1 Input raster file or constant value.
#' @param input2 Input raster file or constant value.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_divide <- function(input1, input2, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input1=", wbt_file_path(input1)))
args <- paste(args, paste0("--input2=", wbt_file_path(input2)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "divide"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Equal to
#'
#' @description Performs a equal-to comparison operation on two rasters or a raster and a constant value.
#'
#' @param input1 Input raster file or constant value.
#' @param input2 Input raster file or constant value.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_equal_to <- function(input1, input2, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input1=", wbt_file_path(input1)))
args <- paste(args, paste0("--input2=", wbt_file_path(input2)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "equal_to"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Exp
#'
#' @description Returns the exponential (base e) of values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.
#' @param verbose_mode Sets verbose mode. If verbose mode is `FALSE`, tools will not print output messages. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_verbose()` for details.
#' @param compress_rasters Sets the flag used by 'WhiteboxTools' to determine whether to use compression for output rasters. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_compress_rasters()` for details.
#' @param command_only Return command that would be executed by `system()` rather than running tool. Default: `FALSE`.
#'
#' @keywords MathandStatsTools
#'
#' @return Returns the tool text outputs.
#' @export
wbt_exp <- function(input, output, wd=NULL, verbose_mode=NULL, compress_rasters=NULL, command_only=FALSE) {
wbt_init()
args <- ""
args <- paste(args, paste0("--input=", wbt_file_path(input)))
args <- paste(args, paste0("--output=", wbt_file_path(output)))
if (!missing(wd)) {
args <- paste(args, paste0("--wd=", wbt_file_path(wd)))
}
if (!missing(compress_rasters)) {
args <- paste(args, paste0("--compress_rasters=", compress_rasters))
}
tool_name <- "exp"
wbt_run_tool(tool_name, args, verbose_mode, command_only)
}
#' @title Exp2
#'
#' @description Returns the exponential (base 2) of values in a raster.
#'
#' @param input Input raster file.
#' @param output Output raster file.
#' @param wd Changes the working directory. Default: `NULL` will use the value in WhiteboxTools settings, see `wbt_wd()` for details.