wpeterman / ResistanceGA

Optimize resistance surfaces using Genetic Algorithms
37 stars 15 forks source link

Question about the output file #24

Closed willright28 closed 2 years ago

willright28 commented 2 years ago

Hi @wpeterman

Thanks for this very helpful R package. I have two questions as follows: First. I want to have a resistance map with a lowest resistance value in the middle. To my knowledge, the "4" means "Ricker" and the middle value, for example, the middle value of elevation, will have the highest resistance value. While the num "8" means "Inverse Ricker" the middle value will have the lowest resistance value. Right? So I set arg select.trans to "8" at first. But the result had a "Ricker" shape which was exactly the opposite of what I wanted. Then I set it to "4" and got a similar result. Please instruct me if I was wrong. Second. How the deal with the categorical file in GA.prep? I have tried to set select.trans to NULL or defalut, but error information appeared. Could you please show me an example?

Thanks in advanced!

willright28 commented 2 years ago

Please let me show you an example. Here is an origin file of elevation: 1 And here is what I want, I created this by using Resistance.tran with "transformation = "Inverse Ricker"": 2

wpeterman commented 2 years ago

In GA.prep it is currently only possible to constrain the class of transformation. For instance, if you want Ricker-type transformations, then specify (for example): GA.prep(ASCII.dir = raster_stack, Results.dir = my_results_dir, select.trans = list("R", NA))

In this example, raster_stack consists of a continuous surface and a categorical surface. If specifying select.trans in GA.prep and a categorical surface is present in your stack of rasters, then you need to provide NA in the list.