sinkovit / Spatial-ecology

Space use software deployed in the Spatial Ecology Gateway
MIT License
2 stars 0 forks source link

Fix area unit selection update issue #52

Closed monaw closed 1 year ago

monaw commented 1 year ago

currently the area unit selection is not updating the table, fix this...

monaw commented 1 year ago

hi @sinkovit , updating the area units by calling the animalAttributes() function doesn't seem to be working right. i have added some print statements for debugging and even though animalAttributes is given the correct areaUnit parameter, it seems the result is not changing...here's the output of my debugging print statements:

Calculating spatial attributes...[1] "animalAttributes: areaUnits = ha"
[1] "animalAttributes: area_mcp = 101.830444970703"
[1] "animalAttributes: areaString = Area (ha)"
 [1] "animalAttributes: result = 1"       "animalAttributes: result = 766841" 
 [3] "animalAttributes: result = 768342"  "animalAttributes: result = 3724208"
 [5] "animalAttributes: result = 3725388" "animalAttributes: result = 101"    
 [7] "animalAttributes: result = 50x39"   "animalAttributes: result = 25x19"  
 [9] "animalAttributes: result = 15x11"   "animalAttributes: result = 5x3"    
done
input$areaunits = m2 
Re-calculating spatial attributes...[1] "animalAttributes: areaUnits = m2"
[1] "animalAttributes: area_mcp = 1018304.44970703"
[1] "animalAttributes: areaString = Area (m2)"
 [1] "animalAttributes: result = 1"         "animalAttributes: result = 766841"   
 [3] "animalAttributes: result = 768342"    "animalAttributes: result = 3724208"  
 [5] "animalAttributes: result = 3725388"   "animalAttributes: result = 1.018e+06"
 [7] "animalAttributes: result = 50x39"     "animalAttributes: result = 25x19"    
 [9] "animalAttributes: result = 15x11"     "animalAttributes: result = 5x3"   

it looks like area_mcp is changing but the result is not. i have checked the code into our dev branch so feel free to pull from the latest commit, run and see the output...

sinkovit commented 1 year ago

Thanks Mona, I'll try to take a look today. I've been wrapped up trying to get the mkde package ready to resubmit to CRAN

sinkovit commented 1 year ago

Hi @monaw

I downloaded the dev version and did some tinkering. I'm not sure if we're looking at the same problem. The area seems to be updating correctly in both the MCP and MKDE tabs. For example, when I switch between m2, ha and km2, the area associated with condor 269 switches between 8.470e+09, 847003 and 8470 as expected.

Now what doesn't seem to work any longer is generating the MCPs. In place of the plot, I get "Error: [object Object]" in red text. Now this could be a problem with my local R installation. I upgraded R and RStudio and it blew away all my installed packages. I think that I reinstalled everything correctly, but maybe not.

sinkovit commented 1 year ago

Hi @monaw

Had you updated the dev branch since you posted the comment? I noticed that the area units is functioning correctly in dev but not in main.

Btw, I can't get the MCP plots to work in main either or in any of the old branches I had laying around. Pretty sure that I broke something with my R installation

sinkovit commented 1 year ago

Hi @monaw Just to clarify, am I being assigned the task of getting my R installation working or further investigating the units selection? My understanding was that you solved the latter.

monaw commented 1 year ago

hi Bob, i thought the calculation for the Area column in the table wasn't working but i just realized i was looking at the wrong thing. i checked again and it seems the area column is correct, can you double check by running the latest dev and if you can verify that it is working, then feel free to close this ticket; otherwise, can you debug the issue and resolve?

sinkovit commented 1 year ago

Just tested and confirmed that the area units are working correctly. Closing this issue.

sinkovit commented 1 year ago

Just tested and confirmed that the area units are working correctly. Closing this issue.