1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | cassavaCropManager(country = c("NG", "TZ"), lat, lon, area,
areaUnits = c("acre", "ha", "m2"), IC = c(TRUE, FALSE),
intercrop = c(NA, "maize", "sweetpotato"), FR = c(NA, TRUE, FALSE),
PP = c(NA, TRUE, FALSE), SPP = c(NA, TRUE, FALSE), SPH = c(NA,
TRUE, FALSE), PD, HD, tractor = c(NA, TRUE, FALSE),
implement = c("plough", "harrow", "ridger"), herbicide = c(NA, TRUE,
FALSE), nTill1 = c(NA, 0, 1, 2), nHarrow = c(NA, 0, 1, 2),
ridges = c(NA, TRUE, FALSE), weedMethod = c("manual", "herbicide"),
costLMO = expand.grid(operation = c("plough1", "plough2", "harrowing",
"ridging"), tractor = c(TRUE, FALSE), cost = NA),
costWCO = expand.grid(operation = c("clearing", "weeding1",
"weeding2"), herbicide = c(TRUE, FALSE), cost = NA), FCY = NA,
CMP = NA, fertilizers = expand.grid(type = c("urea", "CAN",
"NPK17:17:17", "NPK15:15:15", "NPK20:10:10", "DAP", "TSP", "SSP",
"Minjingu_Nafaka+", "MOP"), available = FALSE, price = NA, weight = 50),
saleSF = c(NA, TRUE, FALSE), nameSF = c(NA,
"AlliedAtlanticDistilleries", "MatnaStarch", "PsaltryMarketers",
"PsaltryOutgrowers", "Greentech", "ThaiFarm", "FJS"),
cassPD = c("roots", "chips", "flour", "gari"), cassUW = NA,
cassUP = NA, maizePD = c(NA, "fresh_cob", "dry_cob", "grain"),
maizePC = c(NA, TRUE, FALSE), maizeUW = NA, maizeUP = NA,
maxInv = NA, SMS = c(TRUE, FALSE), email = c(TRUE, FALSE),
userPhoneCC = NA, userPhoneNr = NA, userName = NA,
userEmail = NA, userField = NA)
|
country |
: 2-letter country code |
lat |
: Latitude in decimal degrees |
lon |
: Longitude in decimal degrees |
area |
: Numerical value for area of the field |
areaUnits |
: Units for area (acre, ha or m2) |
IC |
: Logical, indicating if an intercrop (TRUE) or a monocrop (FALSE) is grown |
intercrop |
: Intercrop species grown, either maize or sweetpotato, or NA if monocrop |
FR |
: Logical, indicating if fertilizer recommendations are requested, NA if IC == TRUE and country == "TZ" |
PP |
: Logical, indicating if planting practice recommendations are requested, NA if IC == TRUE or country == "TZ" |
SPP |
: Logical, indicating if scheduled planting - advice on planting date is requested, NA if IC == TRUE |
SPH |
: Logical, indicating if scheduled planting - advice on harvest date is requested, NA if IC == TRUE |
PD |
: Planting date, in format "yyyy-mm-dd" ( \itemHD: Harvest data, in format "yyyy-mm-dd" ( \itemtractor: Logical, indicating if the user has access to a tractor, NA if PP != TRUE \itemimplement: vector containing implements available for tractor (plough, harrow, ridger) \itemherbicide: Logical, indicating if the user has access to herbicides for weed control \itemnTill1: Number of primary tillage operations conducted in current practice (NA, 0, 1, 2), NA if PP != TRUE \itemnHarrow: Number of harrow operations conducted in current practice (NA, 0, 1, 2), NA if PP != TRUE \itemridges: Logical indicating if the farmer ridges his/her field in current practice (NA, TRUE, FALSE), NA if PP != TRUE \itemweedMethod: Vector containing methods used for weed control (NA, manual, herbicide), NA if PP!= TRUE \itemcostLMO: Dataframe containing cost of land management operations; costs are provided in local currency, for the area of the field \itemcostWCO: Dataframe containing cost of weed management operations; costs are provided in local currency, for the area of the field \itemFCY: Farmer-reported current yield, in tonnes FM per ha (optional, default value = NA) \itemCMP: Current maize performance, score on a scale of 1 (very yellow and stunted) .. 5 (tall and dark green), NA if IC != TRUE and FR != TRUE, or NA if the user does not know (NA = default) \itemsaleSF: Logical, indicating if the user is selling roots to a registered starch factory at factory-fixed prices \itemnameSF: Name of starch factory where roots will be sold, NA if saleSF = FALSE \itemcassPD: Type of cassava produce sold (roots, chips, flour, gari) \itemcassUW: Unit weight at which cassava produce is sold, in kg; common measures are 1 (per kg), 50 (per 50kg bag), 100 (per 100kg bag) and 1000 (per tonne); can be NA if user does not know. \itemcassUP: Price of 1 cassava produce unit in local currency; can be NA if user does not know. \itemmaizePD: Type of maize produce sold (fresh cobs, dry cobs, grain), NA if IC != TRUE and country == "NG" \itemmaizePC: Logical indicating if maize is sold per cob (NA, TRUE, FALSE), NA if maizePD != "fresh_cob" \itemmaizeUW: Unit weight at which maize produce is sold, in kg; common measures are 1 (per kg), 50 (per 50kg bag), 100 (per 100kg bag), NA if IC != TRUE and country == "NG" or NA if maizePD == "grain"; can be NA if user does not know. \itemmaizeUP: Price of 1 maize produce unit (or cob, if maizePC == TRUE) in local currency, NA if IC != TRUE and country == "NG"; can be NA if user does not know. \itemmaxInv: Maximal investment in fertilizer, for the area of the field in local currency, NA if FR != TRUE, default = NA (if user does not wish to set an investment ceiling) \itemSMS: Logical indicating if recommendations must be sent by SMS to the user \itememail: Logical indicating if recommendations must be sent by email to the user \itemuserName: Name of the user requesting the recommendations (to be included in the email report), default = NA (if user does not wish to receive recommendations by email) \itemuserEmail: Email address of the user requesting the recommendations (to be included in the email report), default = NA (if user does not wish to receive recommendations by email) \itemuserField: Name or desciption of the field (to be included in the email report, and aid the user to recall for which field recommendations were requested), default = NA (if user does not wish to receive recommendations by email) \itemfertilizers:Dataframe containing available fertilizers and their cost per bag (in local currency) and bag weight (in kg) \itemuserPhoneCC:Country code of the phone number of the user requesting the recommendations (to send recommendations by SMS), default = NA (if user does not wish to receive recommendations by SMS); example 234 for Nigeria \itemuserPhoneNr:Phone number of the user requesting the recommendations, without the initial zero (to send recommendations by SMS), default = NA (if user does not wish to receive recommendations by SMS); excludes the initial zero, stored as numerical (e.g., 789123456) SHORT DEF: Wrapper function to calculate recommendations across all use cases. RETURNS: Vector of with recommendation texts to display. DESCRIPTION: Function with all inputs required by the DST app, and calling use case-specific wrapper functions to calculated recommendations on IC, FR, PP and SP. This function also calls on functions to send recommendation reports by SMS and/or email. INPUT: |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.