Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fertiliser unit conversion #51

Open
rfrelat opened this issue Sep 16, 2022 · 0 comments
Open

Fertiliser unit conversion #51

rfrelat opened this issue Sep 16, 2022 · 0 comments

Comments

@rfrelat
Copy link
Contributor

rfrelat commented Sep 16, 2022

It would be great if the amounts of fertiliser could be converted in kg_per_year (used in the calculation of GHG emissions).
I found the fertiliser_units in rhomis package, but some values are missing (see below).

My script to calculate it (you might find a better way to do it):

#complete the fertilizer_units from RHoMIS package
newunits <- data.frame("survey_value"=c("2.5_kg","FALSE","litres","no_answer","sacks","sacks_20kg","sacks_46kg","tine_20kg","wheelbarrow"),
                       "conversion"=c(2.5,NA,1,NA,50,20,46,20,80))
fertiliser_units <- rbind(fertiliser_units,newunits)

convkg <- fertiliser_units$conversion[match(tab$fertiliser_units, fertiliser_units$survey_value)]
tab$fertiliser_kg_per_year <- tab$fertiliser_amount*convkg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant