Answers to: Example of using external equation for volume calculation (Open Foris Calc)http://www.openforis.org/support/questions/456/example-of-using-external-equation-for-volume-calculation-open-foris-calc<p>Hi,</p>
<p>I am trying to calculate tree volume by applying species-wise volume equations. In R it can be done by looping through codes in equation list and tree data. However, I am not sure how to set this up in my Open Foris Calc "volume Calculation Module". I would very much appreciate any hint. </p>
<p>Thank you.</p>enMon, 19 Sep 2016 09:07:42 +0200Answer by phuquy188http://www.openforis.org/support/questions/456/example-of-using-external-equation-for-volume-calculation-open-foris-calc/732<p>Dear All
I just reach calc. I want to write code to implement R commands in calc calculation.
have you have the documentation and code samples to study it? can you share me?</p>phuquy188Mon, 19 Sep 2016 09:07:42 +0200http://www.openforis.org/support/questions/456/example-of-using-external-equation-for-volume-calculation-open-foris-calc/732Answer by Mino Tognahttp://www.openforis.org/support/questions/456/example-of-using-external-equation-for-volume-calculation-open-foris-calc/484<p>Dear Khanal,</p>
<p>the NA appearing as variable is a bug. it has been fixed and will be released with the next version that is currently under testing.</p>
<p>Yes, you can specify condition. the third column of the CSV file is exactly that.
However, in your case, the last row should contain the equation that will be applied when none of the above criteria matches with your data.</p>
<p>At the moment it's not possible to delete an equation list; you can delete a calculation step that is using that equation list if you don't want to use it anymore. the delete of the equation list has been added to our task lists.</p>
<p>Please let me know if this answers your questions or if you need further information.</p>
<p>Thank you,</p>
<p>Mino</p>Mino TognaWed, 24 Feb 2016 16:00:00 +0100http://www.openforis.org/support/questions/456/example-of-using-external-equation-for-volume-calculation-open-foris-calc/484Answer by Mino Tognahttp://www.openforis.org/support/questions/456/example-of-using-external-equation-for-volume-calculation-open-foris-calc/470<p>Dear Khanal,</p>
<p>The equations themselves are correct.
However, i have noticed two small issues, mainly because i forgot to mention them:</p>
<ol>
<li>
<p>The column condition must return a boolean value. In fact, the system will add a logic AND in addition to the code variable condition.
The line 6 of your CSV contains a condition value, however it doesn't return a boolean value. E.g. that column could be changed as !is.na(abs(height_p)) or removed if it's not what you need.</p>
</li>
<li>
<p>The last row, should contain an equation to apply when none of the previous ones match with your data.
If there's no such default equation to apply to the data, a simple NA should be added.</p>
</li>
</ol>
<p>I have made those updates and the file is available here: <a href="https://www.dropbox.com/s/hsdx8ga5a34kyk3/equation_vol_with_bark_for_all_incl_misc.csv?dl=0">https://www.dropbox.com/s/hsdx8ga5a34kyk3/equation_vol_with_bark_for_all_incl_misc.csv?dl=0</a> </p>
<p>Please let me know if you are still facing problems or if you have other questions,</p>
<p>Thank you,</p>
<p>Mino</p>Mino TognaThu, 18 Feb 2016 09:40:13 +0100http://www.openforis.org/support/questions/456/example-of-using-external-equation-for-volume-calculation-open-foris-calc/470Answer by Mino Tognahttp://www.openforis.org/support/questions/456/example-of-using-external-equation-for-volume-calculation-open-foris-calc/463<p>Dear Khanal,</p>
<p>First, you need to import a valid CSV file containing the equations.
The first column is the code, that is used to identify your data. The second is the equation itself, and the third is the possible further condition you might apply.</p>
<p>After importing the equations, you might need to add a calculation step type 'External equation' and then select from the equation list the one you previously uploaded. Once selected, you might need to identify the variables of your entity that are used to match the variables of your equations.</p>
<p>Please let us know if you have additional questions.</p>
<p>Thank you,
Mino</p>Mino TognaTue, 16 Feb 2016 12:36:00 +0100http://www.openforis.org/support/questions/456/example-of-using-external-equation-for-volume-calculation-open-foris-calc/463