diff --git a/modules/data.land/NAMESPACE b/modules/data.land/NAMESPACE index 1d99ca8e4f3..904d787cd67 100644 --- a/modules/data.land/NAMESPACE +++ b/modules/data.land/NAMESPACE @@ -46,8 +46,8 @@ export(get_veg_module) export(ic_process) export(id_resolveable) export(load_veg) -export(look_up_ca_compost_amendment) export(look_up_ca_n_rate) +export(look_up_ca_organic_amendment) export(look_up_fertilizer_components) export(matchInventoryRings) export(match_pft) diff --git a/modules/data.land/NEWS.md b/modules/data.land/NEWS.md index 702e3484b55..ed1dfdf6355 100644 --- a/modules/data.land/NEWS.md +++ b/modules/data.land/NEWS.md @@ -12,11 +12,12 @@ * Datasets * `landiq_crop_mapping_codes` dataset mapping LandIQ crop classification codes to human-readable crop names. * `bism_kc_by_crop` dataset containing BISm crop coefficient schedules and stage timing references for use in ET estimation, including columns that map to LandIQ class and subclass. - * `ca_n_application_rate` dataset with recommended N application rates (g N/m2) for 33 California crops from CDFA-FREP and UC ANR sources. - * `ca_compost_amendment` dataset with C:N ratios, carbon, nitrogen, and PAN (g/m2) for 32 organic amendment materials. + * `ca_n_application_rate` dataset with recommended N application rates (g N/m2) for 40 California crops from CDFA-FREP, UC ANR, Rosenstock 2013, Brown 2020 NBMP (Almonds age stages) and Lazicki 2016 (Potato) sources. + * `ca_organic_amendment_properties` dataset with C:N ratios, nitrogen, and PAN for 32 organic amendment materials, plus a `material_class` column mapping each material to the CalRecycle taxonomy (14 CCR section 17852). + * `ca_organic_amendment_app_rate` dataset with row-crop and orchard application rate envelopes (64 rows = 32 materials x 2 crop structures) that joins to `ca_organic_amendment_properties` on `material`. * Functions * `look_up_ca_n_rate()` for looking up crop-specific N application rates by name (exact match first, partial match suggestions on miss). - * `look_up_ca_compost_amendment()` for looking up organic amendment properties by material name. + * `look_up_ca_organic_amendment()` for looking up organic amendment properties by material name. * `to_co2e()` for converting SOC change, CH4, and N2O to CO2-equivalent emissions using IPCC Global Warming Potential values. ## Changed diff --git a/modules/data.land/R/data.R b/modules/data.land/R/data.R index 34f5c931c72..975fad76fe4 100644 --- a/modules/data.land/R/data.R +++ b/modules/data.land/R/data.R @@ -209,84 +209,108 @@ #' California recommended N application rates by crop #' -#' Crop-specific recommended nitrogen fertilizer application rates for -#' California agriculture. Contains total-season rates (not per-stage -#' breakdowns). When multiple sources report rates for the same crop, -#' the rate represents the envelope (min of minimums, max of maximums) -#' across sources. -#' -#' @format A tibble with one row per crop and the following columns: +#' Recommended nitrogen fertilizer application rates for California crops. +#' When multiple sources report rates for the same crop the value is the +#' envelope across sources. Crops reported only as within year stages +#' (Barley, Beans, Cauliflower, Melons) have stages summed to an annual +#' total. Crops reported only by age (Almonds) get the envelope across +#' ages. +#' +#' @format A tibble with one row per crop and the columns: #' \describe{ -#' \item{pft_group}{\code{character}. Plant functional type group -#' (e.g. "row", "woody", "rice").} -#' \item{crop}{\code{character}. Crop name as given in the source.} -#' \item{min_n_lbs_acre}{\code{numeric}. Minimum recommended N rate -#' (lbs N/acre).} -#' \item{max_n_lbs_acre}{\code{numeric}. Maximum recommended N rate -#' (lbs N/acre).} -#' \item{source}{\code{character}. Short citation for the source(s). -#' Multiple sources are separated by "; ".} -#' \item{min_n_g_m2}{\code{numeric}. Minimum N rate in SI units -#' (g N/m\eqn{^2}). Conversion: 1 lb/acre = 0.112085 g/m\eqn{^2}.} -#' \item{max_n_g_m2}{\code{numeric}. Maximum N rate in SI units -#' (g N/m\eqn{^2}).} +#' \item{pft_group}{Plant functional type group: \code{"row"}, +#' \code{"woody"}, or \code{"rice"}.} +#' \item{crop}{Crop name as given in the source.} +#' \item{min_n_lbs_acre, max_n_lbs_acre}{Recommended N rate range +#' (lbs N / acre).} +#' \item{source}{Short citation. Multiple sources are joined with +#' \code{"; "}.} +#' \item{min_n_g_m2, max_n_g_m2}{Same range in SI units (g N / m\eqn{^2}).} #' } #' -#' @source Rosenstock, T. S., Liptzin, D., Six, J., & Tomich, T. P. (2013). +#' @source Rosenstock, T. S., Liptzin, D., Six, J., Tomich, T. P. (2013). #' Nitrogen fertilizer use in California: Assessing the data, trends and a -#' way forward. California Agriculture, 67(1). +#' way forward. California Agriculture 67(1). #' \url{https://escholarship.org/uc/item/5mk2q1sm} -#' @source Meyer, R. D., Marcum, D. B., Orloff, S. B., & Schmierer, J. L. +#' @source Meyer, R. D., Marcum, D. B., Orloff, S. B., Schmierer, J. L. #' (2007). Alfalfa fertilization strategies. UC ANR Publication 8296. +#' @source Brown, P. H. et al. (2020). Nitrogen Best Management Practices +#' for Almonds. Almond Board of California. Source for Almonds rates by +#' age. +#' @source Lazicki, P., Geisseler, D., Horwath, W. R. (2016). Potato +#' Production in California. CDFA FREP / UC Davis. Source for Potato. #' -#' @seealso \code{\link{look_up_ca_n_rate}} for looking up rates by crop name. -#' \code{\link{look_up_fertilizer_components}} for fertilizer nutrient -#' composition (N/C fractions) from the SWAT/DayCent database. +#' @seealso \code{\link{look_up_ca_n_rate}}. "ca_n_application_rate" -#' California organic amendment (compost) properties +#' California organic amendment properties #' -#' Properties of organic amendment materials used in California agriculture, -#' including C:N ratios, carbon and nitrogen content, plant-available nitrogen -#' (PAN), and application rates. Some materials appear in multiple rows when -#' values are reported by different sources (e.g. Corn stalks, Cow manure, -#' Vegetable waste). The \code{source} column disambiguates these. +#' Properties of organic amendment materials used in California +#' agriculture: C:N ratio range, total N, plant available N at 4 weeks +#' (PAN), and CalRecycle feedstock class (14 CCR section 17852). +#' Materials reported by more than one source appear once per source; +#' the \code{source} column disambiguates. Application rates live in +#' \code{\link{ca_organic_amendment_app_rate}} and join on +#' \code{material}. #' -#' @format A tibble with 32 rows and the following columns: +#' @format A tibble with 32 rows and the columns: #' \describe{ -#' \item{material}{\code{character}. Amendment material name.} -#' \item{cn_min, cn_max, cn_avg}{\code{numeric}. Carbon-to-nitrogen ratio -#' range and average.} -#' \item{c_pct}{\code{numeric}. Assumed carbon content (percent).} -#' \item{n_pct}{\code{numeric}. Total nitrogen content (percent).} -#' \item{pan_pct}{\code{numeric}. Plant-available nitrogen after 4 weeks -#' (percent). Negative values indicate N immobilization.} -#' \item{n_class}{\code{character}. "LOWER" or "HIGHER" N content class.} -#' \item{app_rate_min, app_rate_max}{\code{numeric}. Application rate range -#' (lbs/acre).} -#' \item{total_c_min_lbs_acre, total_c_max_lbs_acre}{\code{numeric}. -#' Total carbon applied (lbs C/acre).} -#' \item{total_n_min_lbs_acre, total_n_max_lbs_acre}{\code{numeric}. -#' Total nitrogen applied (lbs N/acre).} -#' \item{total_c_min_g_m2, total_c_max_g_m2}{\code{numeric}. -#' Total carbon in SI units (g C/m\eqn{^2}).} -#' \item{total_n_min_g_m2, total_n_max_g_m2}{\code{numeric}. -#' Total nitrogen in SI units (g N/m\eqn{^2}).} -#' \item{source}{\code{character}. Short citation for the data source.} +#' \item{material}{Material name.} +#' \item{material_class}{CalRecycle feedstock class +#' (14 CCR section 17852): one of \code{"ag"}, \code{"food"}, +#' \code{"green"}, \code{"wood"}, \code{"yard"}, \code{"biosolids"}.} +#' \item{cn_min, cn_max, cn_avg}{C:N ratio range.} +#' \item{n_pct}{Total N (percent of dry mass).} +#' \item{pan_pct}{Plant available N at 4 weeks (percent of total N). +#' Negative values indicate net immobilization.} +#' \item{n_class}{N tier reported in the source (\code{"LOWER"} or +#' \code{"HIGHER"}).} +#' \item{source}{Short citation.} #' } #' #' @source Eghball, B. Composting Manure and Other Organic Residues. -#' University of Nebraska-Lincoln Extension, Publication G2222. +#' University of Nebraska Lincoln Extension, Publication G2222. #' \url{https://extensionpubs.unl.edu/publication/g2222/na/html/view} #' @source Rynk, R. (ed.) Compost Production and Use in Sustainable #' Farming Systems. NC State Extension. #' \url{https://content.ces.ncsu.edu/compost-production-and-use-in-sustainable-farming-systems} #' -#' @seealso \code{\link{look_up_ca_compost_amendment}} for looking up -#' amendments by material name. -#' \code{\link{look_up_fertilizer_components}} for fertilizer nutrient -#' composition (N/C fractions) from the SWAT/DayCent database. -"ca_compost_amendment" +#' @seealso \code{\link{ca_organic_amendment_app_rate}}. +#' \code{\link{look_up_ca_organic_amendment}}. +"ca_organic_amendment_properties" + +#' California organic amendment application rates +#' +#' Recommended application rates for each material in +#' \code{\link{ca_organic_amendment_properties}}, broken out by crop +#' structure (row crops vs orchards). The two rate sets are identical +#' for most materials in the source, but a handful of N rich materials +#' (Blood meal, poultry manure) differ between row and tree applications. +#' +#' @format A tibble with 64 rows (32 materials x 2 crop structures) and +#' the columns: +#' \describe{ +#' \item{material}{Material name. Joins to +#' \code{\link{ca_organic_amendment_properties}}.} +#' \item{crop_structure}{\code{"rows"} for annual row crops, +#' \code{"trees"} for perennial orchards.} +#' \item{app_rate_min, app_rate_max}{Amendment application rate range +#' (lbs of amendment / acre).} +#' \item{total_n_min_lbs_acre, total_n_max_lbs_acre}{Total N delivered +#' at those rates (lbs N / acre).} +#' \item{source}{Short citation.} +#' \item{total_n_min_g_m2, total_n_max_g_m2}{Same N range in SI units +#' (g N / m\eqn{^2}).} +#' } +#' +#' @source Eghball, B. Composting Manure and Other Organic Residues. +#' University of Nebraska Lincoln Extension, Publication G2222. +#' @source Rynk, R. (ed.) Compost Production and Use in Sustainable +#' Farming Systems. NC State Extension. +#' +#' @seealso \code{\link{ca_organic_amendment_properties}}. +#' \code{\link{look_up_ca_organic_amendment}}. +"ca_organic_amendment_app_rate" #' Crop-specific rooting depths and water-depletion thresholds #' diff --git a/modules/data.land/R/look_up_ca_n_rate.R b/modules/data.land/R/look_up_ca_n_rate.R index 5ac0f419cc4..73579360a32 100644 --- a/modules/data.land/R/look_up_ca_n_rate.R +++ b/modules/data.land/R/look_up_ca_n_rate.R @@ -100,10 +100,12 @@ look_up_ca_n_rate <- function( } -#' Look up California compost amendment properties +#' Look up California organic amendment properties #' #' Returns properties of organic amendment materials including carbon and #' nitrogen content, C:N ratio, and plant-available nitrogen (PAN). +#' Application rates live in +#' \code{\link{ca_organic_amendment_app_rate}}; join on \code{material}. #' #' Matching is case-insensitive. Exact matches are returned directly. #' If no exact match is found, partial matching suggests possible materials. @@ -117,10 +119,8 @@ look_up_ca_n_rate <- function( #' @param aggregate Character, one of "none" (default) or "mean". #' If "mean", rows for the same material are averaged into a single row. #' -#' @return A tibble with columns: `material`, `cn_min`, `cn_max`, -#' `cn_avg`, `c_pct`, `n_pct`, `pan_pct`, `n_class`, -#' `total_c_min_g_m2`, `total_c_max_g_m2`, -#' `total_n_min_g_m2`, `total_n_max_g_m2`, `source`. +#' @return A tibble with columns: `material`, `material_class`, +#' `cn_min`, `cn_max`, `cn_avg`, `n_pct`, `pan_pct`, `n_class`, `source`. #' Returns an empty tibble (with a warning) if no match is found. #' #' @source Eghball, B. Composting Manure and Other Organic Residues. @@ -132,21 +132,22 @@ look_up_ca_n_rate <- function( #' #' @seealso [look_up_fertilizer_components()] for fertilizer nutrient #' composition (N/C fractions) from the SWAT/DayCent database. -#' [ca_compost_amendment] for the underlying dataset. +#' [ca_organic_amendment_properties] for the underlying dataset. +#' [ca_organic_amendment_app_rate] for the matching application rates. #' #' @examples -#' look_up_ca_compost_amendment("Cow manure") -#' look_up_ca_compost_amendment("Cow manure", aggregate = "mean") -#' look_up_ca_compost_amendment("Poultry litter", n_class = "LOWER") +#' look_up_ca_organic_amendment("Cow manure") +#' look_up_ca_organic_amendment("Cow manure", aggregate = "mean") +#' look_up_ca_organic_amendment("Poultry litter", n_class = "LOWER") #' #' @export -look_up_ca_compost_amendment <- function( +look_up_ca_organic_amendment <- function( material, n_class = NULL, aggregate = c("none", "mean") ) { aggregate <- match.arg(aggregate) - dat <- PEcAn.data.land::ca_compost_amendment + dat <- PEcAn.data.land::ca_organic_amendment_properties if (!is.null(n_class)) { dat <- dat |> @@ -170,37 +171,33 @@ look_up_ca_compost_amendment <- function( ) } else { PEcAn.logger::logger.warn( - "No compost amendment found for material '", material, "'" + "No organic amendment found for material '", material, "'" ) } return(dplyr::tibble( - material = character(), cn_min = numeric(), cn_max = numeric(), - cn_avg = numeric(), c_pct = numeric(), + material = character(), material_class = character(), + cn_min = numeric(), cn_max = numeric(), cn_avg = numeric(), n_pct = numeric(), pan_pct = numeric(), n_class = character(), - total_c_min_g_m2 = numeric(), total_c_max_g_m2 = numeric(), - total_n_min_g_m2 = numeric(), total_n_max_g_m2 = numeric(), source = character() )) } out <- result |> dplyr::select( - "material", "cn_min", "cn_max", "cn_avg", - "c_pct", "n_pct", "pan_pct", "n_class", - "total_c_min_g_m2", "total_c_max_g_m2", - "total_n_min_g_m2", "total_n_max_g_m2", + "material", "material_class", + "cn_min", "cn_max", "cn_avg", + "n_pct", "pan_pct", "n_class", "source" ) if (aggregate == "mean" && nrow(out) > 1) { numeric_cols <- c( - "cn_min", "cn_max", "cn_avg", "c_pct", "n_pct", "pan_pct", - "total_c_min_g_m2", "total_c_max_g_m2", - "total_n_min_g_m2", "total_n_max_g_m2" + "cn_min", "cn_max", "cn_avg", "n_pct", "pan_pct" ) out <- out |> dplyr::summarize( dplyr::across(dplyr::all_of(numeric_cols), mean), + material_class = dplyr::first(.data$material_class), n_class = dplyr::first(.data$n_class), source = paste(unique(.data$source), collapse = "; "), .by = "material" diff --git a/modules/data.land/data-raw/README.md b/modules/data.land/data-raw/README.md index a5d81ffbd05..1e295e410b3 100644 --- a/modules/data.land/data-raw/README.md +++ b/modules/data.land/data-raw/README.md @@ -27,3 +27,103 @@ from which it is lazy-loaded when `soil_class` is used inside package functions. The saved file includes all of `texture.csv`, hence why that lives in `data-raw` rather than directly in `data/`. + + +# California fertilization datasets + +Three datasets for nitrogen management on California crops. Like BADM +above, each one ships as a harmonized CSV in this folder, and its +`create_*.R` script just reads that CSV and writes the `.rda`, nothing +fancy. `ca_n_application_rate` carries recommended N rate ranges for 40 +crops. `ca_organic_amendment_properties` carries the intrinsic +properties of 32 amendment materials (C:N, total N, plant available N at +4 weeks, and the CalRecycle feedstock class). +`ca_organic_amendment_app_rate` carries how much of each material you +put down, 64 rows because every material gets one rate for row crops and +one for orchards. + +The CSVs are not where the work happens. They fall out of +`harmonize_fertilization_data.R`, which lives with the rest of the CCMMF +management workflow under +`/projectnb/dietzelab/ccmmf/management/fertilization/`, outside this +package. That script reads the curated TSV exports of the CCMMF +fertilization spreadsheet, maps the source URLs to short author-year +citations, folds the per-stage N rows into one range per crop, converts +lbs/acre to g/m2 with `PEcAn.utils::ud_convert`, splits the +spreadsheet's wide Rows/Trees layout into the long properties and +app-rate tables, drops a couple of bad columns, and assigns the +`material_class`. Whatever lands in the three CSVs here is what the +package builds from. + +## Where the numbers come from + +The N rates trace back to Rosenstock et al. 2013 (*California +Agriculture* 67(1), doi:10.3733/ca.E.v067n01p68), the CDFA-FREP and UC +Davis fertilization guidelines, Meyer et al. 2007 for alfalfa (UC ANR +pubs 8292 and 8296), Brown et al. 2020 NBMP Table 2 for almonds by age +(Almond Board of California), and Lazicki, Geisseler and Horwath 2016 +for potato (CDFA-FREP / UC Davis). The citation for each crop sits in +its `source` column. The `pft_group` labels (row, woody, rice) come +straight off the spreadsheet, hand-authored rather than mapped from +`cadwr_pfts.csv`, though they follow the same grouping it uses. + +The amendment numbers come from Eghball (UNL Extension G2222) and Rynk +(NC State Extension compost handbook), again cited per row. +`material_class` is the one field we set by hand, slotting each material +into the CalRecycle feedstock taxonomy from 14 CCR 17852. The current 32 +materials only land in four of the classes (ag, food, yard, wood); green +and biosolids are valid classes but nothing here falls in them. + +Everything else is verbatim off the spreadsheet: crop, pft_group, +material, total N, PAN, the C:N range, the N tier, and the raw Rows and +Trees application rates. The pieces we computed or assigned are the +per-crop N range (aggregated as below), the short citation strings, the +`material_class`, the `crop_structure` label, and every g/m2 column +(converted from lbs/acre). + +## How the per-crop N range gets built + +Most crops, 33 of them, report a whole season rate, so we take that +range as is. Six report only by growth stage (Barley, the three Beans, +Cauliflower, Melons), so their within year stages get summed into a +season total. Almonds are the odd one out, reporting by orchard age +across 8 NBMP stages, so there we envelope the low and high across all +ages. Onions drop out, since its only row is a "1/3 of total N at +preplant" note with no rate attached. + +## Fixes we made at the source + +A few things in the spreadsheet were wrong and got fixed upstream before +harmonizing: + +- Dropped `Peach, bell` and `Peach, chili`. Their numbers were + byte for byte copies of `Pepper, bell` and `Pepper, chili`, and the + paper they cite (Rosenstock 2013 Table 2, p. 76) lists no peach-bell + or peach-chili at all. Clearly a copy paste slip. +- Added `Potato` at 189 to 248 lb N/acre from Lazicki, Geisseler and + Horwath 2016. Worth being upfront: Rosenstock 2013 p. 76 says outright + that no UC ANR guideline exists for potato in California, so this is a + grower-reported envelope, not an official guideline. +- Tossed the `Total_C` columns. The spreadsheet built them as + `Total_N * C_assumed` instead of `AppRate * C_assumed`, which is + dimensionally wrong and would feed the model garbage carbon inputs. +- Added the `material_class` column with the 32 hand-assigned CalRecycle + classes. + +One more on the amendment rates: for 30 of the 32 materials the row-crop +and orchard rates match in the spreadsheet, but two N-rich materials +(Blood meal and fresh poultry manure) carry lower rates on trees than on +rows. Splitting into the long app-rate table keeps both rather than +picking one. + +## Updating the data + +1. Edit the source TSV under + `/projectnb/dietzelab/ccmmf/management/fertilization/`. +2. Rerun `harmonize_fertilization_data.R` from that folder. It + overwrites the three `ca_*.csv` files there. +3. Copy those three CSVs into this folder. +4. Rerun `create_ca_n_application_rate.R` and + `create_ca_organic_amendment.R`. +5. Bump the package version, add a `NEWS.md` line, and regenerate the + man pages with `devtools::document()`. diff --git a/modules/data.land/data-raw/n_application_rates.csv b/modules/data.land/data-raw/ca_n_application_rate.csv similarity index 50% rename from modules/data.land/data-raw/n_application_rates.csv rename to modules/data.land/data-raw/ca_n_application_rate.csv index f733617ab91..ee822dc6385 100644 --- a/modules/data.land/data-raw/n_application_rates.csv +++ b/modules/data.land/data-raw/ca_n_application_rate.csv @@ -1,34 +1,41 @@ pft_group,crop,min_n_lbs_acre,max_n_lbs_acre,source,min_n_g_m2,max_n_g_m2 -woody,Avocado,67,100,"Rosenstock et al., 2013",7.51,11.209 +rice,Rice,110,145,"Rosenstock et al., 2013",12.329,16.252 +row,Alfalfa,0,0,Meyer et al. 2007. Pub. 8292,0,0 +row,Barley,65,250,CDFA-FREP & UC Davis,7.286,28.021 +row,"Bean, blackeye",0,8,CDFA-FREP & UC Davis,0,0.897 +row,"Bean, common",70,300,CDFA-FREP & UC Davis,7.846,33.625 row,"Bean, dry",86,116,"Rosenstock et al., 2013",9.639,13.002 -row,Broccoli,100,240,"Rosenstock et al., 2013; CDFA-FREP & UC Davis",11.209,26.9 -row,Carrot,100,250,"Rosenstock et al., 2013",11.209,28.021 +row,"Bean, lima",55,233,CDFA-FREP & UC Davis,6.165,26.116 +row,Broccoli,100,240,"Rosenstock et al., 2013; CDFA-FREP & UC Davis",11.208,26.9 +row,Carrot,100,250,"Rosenstock et al., 2013",11.208,28.021 +row,Cauliflower,40,60,CDFA-FREP & UC Davis,4.483,6.725 row,Celery,200,275,"Rosenstock et al., 2013",22.417,30.823 row,Corn,150,275,"Rosenstock et al., 2013",16.813,30.823 -row,"Corn, sweet",100,200,"Rosenstock et al., 2013",11.209,22.417 -row,Cotton,100,200,"Rosenstock et al., 2013",11.209,22.417 -woody,"Grape, raisin",20,60,"Rosenstock et al., 2013",2.242,6.725 -woody,Grapevines,20,60,Meyer et al. 2007. Pub. 8296,2.242,6.725 +row,"Corn, sweet",100,200,"Rosenstock et al., 2013",11.208,22.417 +row,Cotton,100,200,"Rosenstock et al., 2013",11.208,22.417 row,Lettuce,170,220,"Rosenstock et al., 2013",19.054,24.659 row,"Melon, cantaloupe",80,150,"Rosenstock et al., 2013",8.967,16.813 row,"Melon, watermelon",0,160,"Rosenstock et al., 2013",0,17.934 -row,Melons (mixed),100,150,"Rosenstock et al., 2013",11.209,16.813 -woody,Nectarine,100,150,"Rosenstock et al., 2013",11.209,16.813 +row,Melons,80,200,CDFA-FREP & UC Davis,8.967,22.417 +row,Melons (mixed),100,150,"Rosenstock et al., 2013",11.208,16.813 row,Oats,50,120,"Rosenstock et al., 2013",5.604,13.45 -row,Onion,100,400,"Rosenstock et al., 2013",11.209,44.834 -woody,"Peach, bell",180,240,"Rosenstock et al., 2013",20.175,26.9 -woody,"Peach, chili",150,200,"Rosenstock et al., 2013",16.813,22.417 -woody,"Peach, cling",50,100,"Rosenstock et al., 2013",5.604,11.209 -woody,"Peach, free",50,100,"Rosenstock et al., 2013",5.604,11.209 +row,Onion,100,400,"Rosenstock et al., 2013",11.208,44.834 row,"Pepper, bell",180,240,"Rosenstock et al., 2013",20.175,26.9 row,"Pepper, chili",150,200,"Rosenstock et al., 2013",16.813,22.417 -woody,Pistachios,100,225,"Rosenstock et al., 2013",11.209,25.219 -woody,"Plums, dried",0,100,"Rosenstock et al., 2013",0,11.209 -woody,"Plums, fresh",110,150,"Rosenstock et al., 2013",12.329,16.813 -rice,Rice,110,145,"Rosenstock et al., 2013",12.329,16.252 -row,Safflower,100,150,"Rosenstock et al., 2013",11.209,16.813 -row,Strawberry,150,300,"Rosenstock et al., 2013",16.813,33.626 +row,Potato,189,248,"Lazicki et al. 2016, CDFA-FREP UC Davis",21.184,27.797 +row,Safflower,100,150,"Rosenstock et al., 2013",11.208,16.813 +row,Strawberry,150,300,"Rosenstock et al., 2013",16.813,33.625 row,"Tomatoes, fresh market",125,350,"Rosenstock et al., 2013",14.011,39.23 -row,"Tomatoes, processing",100,150,"Rosenstock et al., 2013",11.209,16.813 +row,"Tomatoes, processing",100,150,"Rosenstock et al., 2013",11.208,16.813 +row,Wheat,100,240,"Rosenstock et al., 2013",11.208,26.9 +woody,Almonds,30,255,Brown et al. 2020 NBMP Table 2,3.363,28.582 +woody,Avocado,67,100,"Rosenstock et al., 2013",7.51,11.208 +woody,"Grape, raisin",20,60,"Rosenstock et al., 2013",2.242,6.725 +woody,Grapevines,20,60,Meyer et al. 2007. Pub. 8296,2.242,6.725 +woody,Nectarine,100,150,"Rosenstock et al., 2013",11.208,16.813 +woody,"Peach, cling",50,100,"Rosenstock et al., 2013",5.604,11.208 +woody,"Peach, free",50,100,"Rosenstock et al., 2013",5.604,11.208 +woody,Pistachios,100,225,"Rosenstock et al., 2013",11.208,25.219 +woody,"Plums, dried",0,100,"Rosenstock et al., 2013",0,11.208 +woody,"Plums, fresh",110,150,"Rosenstock et al., 2013",12.329,16.813 woody,Walnuts,150,200,"Rosenstock et al., 2013",16.813,22.417 -row,Wheat,100,240,"Rosenstock et al., 2013",11.209,26.9 diff --git a/modules/data.land/data-raw/ca_organic_amendment_app_rate.csv b/modules/data.land/data-raw/ca_organic_amendment_app_rate.csv new file mode 100644 index 00000000000..cd5b9e22fbd --- /dev/null +++ b/modules/data.land/data-raw/ca_organic_amendment_app_rate.csv @@ -0,0 +1,65 @@ +material,crop_structure,app_rate_min,app_rate_max,total_n_min_lbs_acre,total_n_max_lbs_acre,source,total_n_min_g_m2,total_n_max_g_m2 +Alfalfa hay,rows,8000,10600,246.15,326.15,"Eghball, UNL Extension",27.59,36.556 +Alfalfa hay,trees,8000,10600,246.15,326.15,"Eghball, UNL Extension",27.59,36.556 +Apple pomace,rows,8000,10600,152.38,201.9,"Eghball, UNL Extension",17.079,22.63 +Apple pomace,trees,8000,10600,152.38,201.9,"Eghball, UNL Extension",17.079,22.63 +Bark,rows,8000,10600,27.83,36.87,"Eghball, UNL Extension",3.119,4.133 +Bark,trees,8000,10600,27.83,36.87,"Eghball, UNL Extension",3.119,4.133 +Blood meal,rows,4400,7200,440,720,"Eghball, UNL Extension",49.317,80.701 +Blood meal,trees,3000,5800,300,580,"Eghball, UNL Extension",33.625,65.009 +Coffee grounds,rows,8000,10600,160,212,"Eghball, UNL Extension",17.934,23.762 +Coffee grounds,trees,8000,10600,160,212,"Eghball, UNL Extension",17.934,23.762 +Corn cobs,rows,8000,10600,37.65,49.88,"Eghball, UNL Extension",4.22,5.591 +Corn cobs,trees,8000,10600,37.65,49.88,"Eghball, UNL Extension",4.22,5.591 +Corn stalks,rows,8000,10600,49.23,65.23,"Rynk, NC State Extension",5.518,7.311 +Corn stalks,rows,8000,10600,40,53,"Eghball, UNL Extension",4.483,5.94 +Corn stalks,trees,8000,10600,49.23,65.23,"Rynk, NC State Extension",5.518,7.311 +Corn stalks,trees,8000,10600,40,53,"Eghball, UNL Extension",4.483,5.94 +Cow manure,rows,8000,10600,142.22,188.44,"Rynk, NC State Extension",15.941,21.121 +Cow manure,rows,8000,10600,160,212,"Eghball, UNL Extension",17.934,23.762 +Cow manure,trees,8000,10600,142.22,188.44,"Rynk, NC State Extension",15.941,21.121 +Cow manure,trees,8000,10600,160,212,"Eghball, UNL Extension",17.934,23.762 +Dry leaves,rows,8000,10600,58.18,77.09,"Rynk, NC State Extension",6.521,8.641 +Dry leaves,trees,8000,10600,58.18,77.09,"Rynk, NC State Extension",6.521,8.641 +Fruit waste,rows,8000,10600,91.43,121.14,"Eghball, UNL Extension",10.248,13.578 +Fruit waste,trees,8000,10600,91.43,121.14,"Eghball, UNL Extension",10.248,13.578 +Grass,rows,8000,10600,172.97,229.19,"Rynk, NC State Extension",19.387,25.689 +Grass,trees,8000,10600,172.97,229.19,"Rynk, NC State Extension",19.387,25.689 +Grass clippings,rows,8000,10600,172.97,229.19,"Eghball, UNL Extension",19.387,25.689 +Grass clippings,trees,8000,10600,172.97,229.19,"Eghball, UNL Extension",19.387,25.689 +Horse manure,rows,8000,10600,128,169.6,"Rynk, NC State Extension",14.347,19.01 +Horse manure,trees,8000,10600,128,169.6,"Rynk, NC State Extension",14.347,19.01 +Leaves,rows,8000,10600,53.33,70.67,"Eghball, UNL Extension",5.977,7.921 +Leaves,trees,8000,10600,53.33,70.67,"Eghball, UNL Extension",5.977,7.921 +Manure with litter — horse,rows,8000,10600,71.11,94.22,"Eghball, UNL Extension",7.97,10.561 +Manure with litter — horse,trees,8000,10600,71.11,94.22,"Eghball, UNL Extension",7.97,10.561 +Manure with litter — poultry,rows,8000,10600,206.45,273.55,"Eghball, UNL Extension",23.14,30.661 +Manure with litter — poultry,trees,8000,10600,206.45,273.55,"Eghball, UNL Extension",23.14,30.661 +Manure — cow and horse,rows,8000,10600,142.22,188.44,"Eghball, UNL Extension",15.941,21.121 +Manure — cow and horse,trees,8000,10600,142.22,188.44,"Eghball, UNL Extension",15.941,21.121 +Manure — poultry (fresh),rows,4400,7200,176,288,"Eghball, UNL Extension",19.727,32.28 +Manure — poultry (fresh),trees,3000,5800,120,232,"Eghball, UNL Extension",13.45,26.004 +Newspaper,rows,8000,10600,5.33,7.07,"Rynk, NC State Extension",0.597,0.792 +Newspaper,trees,8000,10600,5.33,7.07,"Rynk, NC State Extension",0.597,0.792 +"Newspaper, shredded",rows,8000,10600,5.33,7.07,"Eghball, UNL Extension",0.597,0.792 +"Newspaper, shredded",trees,8000,10600,5.33,7.07,"Eghball, UNL Extension",0.597,0.792 +Paper,rows,8000,10600,18.29,24.23,"Eghball, UNL Extension",2.05,2.716 +Paper,trees,8000,10600,18.29,24.23,"Eghball, UNL Extension",2.05,2.716 +Pine needles,rows,8000,10600,40,53,"Eghball, UNL Extension",4.483,5.94 +Pine needles,trees,8000,10600,40,53,"Eghball, UNL Extension",4.483,5.94 +Poultry litter,rows,8000,10600,256,339.2,"Rynk, NC State Extension",28.694,38.019 +Poultry litter,trees,8000,10600,256,339.2,"Rynk, NC State Extension",28.694,38.019 +Sawdust and wood chips,rows,8000,10600,10.67,14.13,"Eghball, UNL Extension",1.196,1.584 +Sawdust and wood chips,trees,8000,10600,10.67,14.13,"Eghball, UNL Extension",1.196,1.584 +Straw,rows,8000,10600,45.71,60.57,"Rynk, NC State Extension",5.123,6.789 +Straw,trees,8000,10600,45.71,60.57,"Rynk, NC State Extension",5.123,6.789 +Straw — oats and wheat,rows,8000,10600,42.67,56.53,"Eghball, UNL Extension",4.783,6.336 +Straw — oats and wheat,trees,8000,10600,42.67,56.53,"Eghball, UNL Extension",4.783,6.336 +Swine manure,rows,8000,10600,228.57,302.86,"Rynk, NC State Extension",25.619,33.946 +Swine manure,trees,8000,10600,228.57,302.86,"Rynk, NC State Extension",25.619,33.946 +Vegetable waste,rows,8000,10600,213.33,282.67,"Rynk, NC State Extension",23.911,31.683 +Vegetable waste,rows,8000,10600,200,265,"Eghball, UNL Extension",22.417,29.702 +Vegetable waste,trees,8000,10600,213.33,282.67,"Rynk, NC State Extension",23.911,31.683 +Vegetable waste,trees,8000,10600,200,265,"Eghball, UNL Extension",22.417,29.702 +Woodchips,rows,8000,10600,10.67,14.13,"Rynk, NC State Extension",1.196,1.584 +Woodchips,trees,8000,10600,10.67,14.13,"Rynk, NC State Extension",1.196,1.584 diff --git a/modules/data.land/data-raw/ca_organic_amendment_properties.csv b/modules/data.land/data-raw/ca_organic_amendment_properties.csv new file mode 100644 index 00000000000..3b7dbc3d507 --- /dev/null +++ b/modules/data.land/data-raw/ca_organic_amendment_properties.csv @@ -0,0 +1,33 @@ +material,material_class,cn_min,cn_max,cn_avg,n_pct,pan_pct,n_class,source +Alfalfa hay,ag,13,13,13,3.08,16.15,LOWER,"Eghball, UNL Extension" +Apple pomace,food,21,21,21,1.9,-1.43,LOWER,"Eghball, UNL Extension" +Bark,wood,100,130,115,0.35,-24.78,LOWER,"Eghball, UNL Extension" +Blood meal,ag,4,4,4,10,60,HIGHER,"Eghball, UNL Extension" +Coffee grounds,food,20,20,20,2,0,LOWER,"Eghball, UNL Extension" +Corn cobs,ag,50,120,85,0.47,-22.94,LOWER,"Eghball, UNL Extension" +Corn stalks,ag,60,70,65,0.62,-20.77,LOWER,"Rynk, NC State Extension" +Corn stalks,ag,80,80,80,0.5,-22.5,LOWER,"Eghball, UNL Extension" +Cow manure,ag,20,25,22.5,1.78,-3.33,LOWER,"Rynk, NC State Extension" +Cow manure,ag,20,20,20,2,0,LOWER,"Eghball, UNL Extension" +Dry leaves,yard,30,80,55,0.73,-19.09,LOWER,"Rynk, NC State Extension" +Fruit waste,food,35,35,35,1.14,-12.86,LOWER,"Eghball, UNL Extension" +Grass,yard,12,25,18.5,2.16,2.43,LOWER,"Rynk, NC State Extension" +Grass clippings,yard,12,25,18.5,2.16,2.43,LOWER,"Eghball, UNL Extension" +Horse manure,ag,20,30,25,1.6,-6,LOWER,"Rynk, NC State Extension" +Leaves,yard,40,80,60,0.67,-20,LOWER,"Eghball, UNL Extension" +Manure — cow and horse,ag,20,25,22.5,1.78,-3.33,LOWER,"Eghball, UNL Extension" +Manure — poultry (fresh),ag,10,10,10,4,30,HIGHER,"Eghball, UNL Extension" +Manure with litter — horse,ag,30,60,45,0.89,-16.67,LOWER,"Eghball, UNL Extension" +Manure with litter — poultry,ag,13,18,15.5,2.58,8.71,LOWER,"Eghball, UNL Extension" +Newspaper,wood,400,800,600,0.07,-29,LOWER,"Rynk, NC State Extension" +"Newspaper, shredded",wood,400,800,600,0.07,-29,LOWER,"Eghball, UNL Extension" +Paper,wood,150,200,175,0.23,-26.57,LOWER,"Eghball, UNL Extension" +Pine needles,yard,80,80,80,0.5,-22.5,LOWER,"Eghball, UNL Extension" +Poultry litter,ag,5,20,12.5,3.2,18,LOWER,"Rynk, NC State Extension" +Sawdust and wood chips,wood,100,500,300,0.13,-28,LOWER,"Eghball, UNL Extension" +Straw,ag,40,100,70,0.57,-21.43,LOWER,"Rynk, NC State Extension" +Straw — oats and wheat,ag,70,80,75,0.53,-22,LOWER,"Eghball, UNL Extension" +Swine manure,ag,8,20,14,2.86,12.86,LOWER,"Rynk, NC State Extension" +Vegetable waste,food,10,20,15,2.67,10,LOWER,"Rynk, NC State Extension" +Vegetable waste,food,12,20,16,2.5,7.5,LOWER,"Eghball, UNL Extension" +Woodchips,wood,100,500,300,0.13,-28,LOWER,"Rynk, NC State Extension" diff --git a/modules/data.land/data-raw/compost_amendments.csv b/modules/data.land/data-raw/compost_amendments.csv deleted file mode 100644 index 85db72542b2..00000000000 --- a/modules/data.land/data-raw/compost_amendments.csv +++ /dev/null @@ -1,33 +0,0 @@ -material,cn_min,cn_max,cn_avg,c_pct,n_pct,pan_pct,n_class,app_rate_min,app_rate_max,total_c_min_lbs_acre,total_c_max_lbs_acre,total_n_min_lbs_acre,total_n_max_lbs_acre,total_c_min_g_m2,total_c_max_g_m2,total_n_min_g_m2,total_n_max_g_m2,source -Alfalfa hay,13,13,13,40,3.08,16.15,LOWER,8000,10600,3200,4240,246.15,326.15,358.672,475.24,27.59,36.557,"Eghball, UNL Extension" -Apple pomace,21,21,21,40,1.9,-1.43,LOWER,8000,10600,3200,4240,152.38,201.9,358.672,475.24,17.08,22.63,"Eghball, UNL Extension" -Bark,100,130,115,40,0.35,-24.78,LOWER,8000,10600,3200,4240,27.83,36.87,358.672,475.24,3.119,4.133,"Eghball, UNL Extension" -Blood meal,4,4,4,40,10,60,HIGHER,4400,7200,1760,2880,440,720,197.27,322.805,49.317,80.701,"Eghball, UNL Extension" -Coffee grounds,20,20,20,40,2,0,LOWER,8000,10600,3200,4240,160,212,358.672,475.24,17.934,23.762,"Eghball, UNL Extension" -Corn cobs,50,120,85,40,0.47,-22.94,LOWER,8000,10600,3200,4240,37.65,49.88,358.672,475.24,4.22,5.591,"Eghball, UNL Extension" -Corn stalks,60,70,65,40,0.62,-20.77,LOWER,8000,10600,3200,4240,49.23,65.23,358.672,475.24,5.518,7.311,"Rynk, NC State Extension" -Corn stalks,80,80,80,40,0.5,-22.5,LOWER,8000,10600,3200,4240,40,53,358.672,475.24,4.483,5.941,"Eghball, UNL Extension" -Cow manure,20,25,22.5,40,1.78,-3.33,LOWER,8000,10600,3200,4240,142.22,188.44,358.672,475.24,15.941,21.121,"Rynk, NC State Extension" -Cow manure,20,20,20,40,2,0,LOWER,8000,10600,3200,4240,160,212,358.672,475.24,17.934,23.762,"Eghball, UNL Extension" -Dry leaves,30,80,55,40,0.73,-19.09,LOWER,8000,10600,3200,4240,58.18,77.09,358.672,475.24,6.521,8.641,"Rynk, NC State Extension" -Fruit waste,35,35,35,40,1.14,-12.86,LOWER,8000,10600,3200,4240,91.43,121.14,358.672,475.24,10.248,13.578,"Eghball, UNL Extension" -Grass,12,25,18.5,40,2.16,2.43,LOWER,8000,10600,3200,4240,172.97,229.19,358.672,475.24,19.387,25.689,"Rynk, NC State Extension" -Grass clippings,12,25,18.5,40,2.16,2.43,LOWER,8000,10600,3200,4240,172.97,229.19,358.672,475.24,19.387,25.689,"Eghball, UNL Extension" -Horse manure,20,30,25,40,1.6,-6,LOWER,8000,10600,3200,4240,128,169.6,358.672,475.24,14.347,19.01,"Rynk, NC State Extension" -Leaves,40,80,60,40,0.67,-20,LOWER,8000,10600,3200,4240,53.33,70.67,358.672,475.24,5.977,7.921,"Eghball, UNL Extension" -Manure — cow and horse,20,25,22.5,40,1.78,-3.33,LOWER,8000,10600,3200,4240,142.22,188.44,358.672,475.24,15.941,21.121,"Eghball, UNL Extension" -Manure — poultry (fresh),10,10,10,40,4,30,HIGHER,4400,7200,1760,2880,176,288,197.27,322.805,19.727,32.28,"Eghball, UNL Extension" -Manure with litter — horse,30,60,45,40,0.89,-16.67,LOWER,8000,10600,3200,4240,71.11,94.22,358.672,475.24,7.97,10.561,"Eghball, UNL Extension" -Manure with litter — poultry,13,18,15.5,40,2.58,8.71,LOWER,8000,10600,3200,4240,206.45,273.55,358.672,475.24,23.14,30.661,"Eghball, UNL Extension" -Newspaper,400,800,600,40,0.07,-29,LOWER,8000,10600,3200,4240,5.33,7.07,358.672,475.24,0.597,0.792,"Rynk, NC State Extension" -"Newspaper, shredded",400,800,600,40,0.07,-29,LOWER,8000,10600,3200,4240,5.33,7.07,358.672,475.24,0.597,0.792,"Eghball, UNL Extension" -Paper,150,200,175,40,0.23,-26.57,LOWER,8000,10600,3200,4240,18.29,24.23,358.672,475.24,2.05,2.716,"Eghball, UNL Extension" -Pine needles,80,80,80,40,0.5,-22.5,LOWER,8000,10600,3200,4240,40,53,358.672,475.24,4.483,5.941,"Eghball, UNL Extension" -Poultry litter,5,20,12.5,40,3.2,18,LOWER,8000,10600,3200,4240,256,339.2,358.672,475.24,28.694,38.019,"Rynk, NC State Extension" -Sawdust and wood chips,100,500,300,40,0.13,-28,LOWER,8000,10600,3200,4240,10.67,14.13,358.672,475.24,1.196,1.584,"Eghball, UNL Extension" -Straw,40,100,70,40,0.57,-21.43,LOWER,8000,10600,3200,4240,45.71,60.57,358.672,475.24,5.123,6.789,"Rynk, NC State Extension" -Straw — oats and wheat,70,80,75,40,0.53,-22,LOWER,8000,10600,3200,4240,42.67,56.53,358.672,475.24,4.783,6.336,"Eghball, UNL Extension" -Swine manure,8,20,14,40,2.86,12.86,LOWER,8000,10600,3200,4240,228.57,302.86,358.672,475.24,25.619,33.946,"Rynk, NC State Extension" -Vegetable waste,10,20,15,40,2.67,10,LOWER,8000,10600,3200,4240,213.33,282.67,358.672,475.24,23.911,31.683,"Rynk, NC State Extension" -Vegetable waste,12,20,16,40,2.5,7.5,LOWER,8000,10600,3200,4240,200,265,358.672,475.24,22.417,29.703,"Eghball, UNL Extension" -Woodchips,100,500,300,40,0.13,-28,LOWER,8000,10600,3200,4240,10.67,14.13,358.672,475.24,1.196,1.584,"Rynk, NC State Extension" diff --git a/modules/data.land/data-raw/create_ca_n_application_rate.R b/modules/data.land/data-raw/create_ca_n_application_rate.R new file mode 100644 index 00000000000..87308b3822c --- /dev/null +++ b/modules/data.land/data-raw/create_ca_n_application_rate.R @@ -0,0 +1,10 @@ +#!/usr/bin/env Rscript + +# Build ca_n_application_rate from the harmonized CSV in this folder + +ca_n_application_rate <- readr::read_csv( + file.path("data-raw", "ca_n_application_rate.csv"), + show_col_types = FALSE +) + +usethis::use_data(ca_n_application_rate, overwrite = TRUE) diff --git a/modules/data.land/data-raw/create_ca_organic_amendment.R b/modules/data.land/data-raw/create_ca_organic_amendment.R new file mode 100644 index 00000000000..4b01743831f --- /dev/null +++ b/modules/data.land/data-raw/create_ca_organic_amendment.R @@ -0,0 +1,17 @@ +#!/usr/bin/env Rscript + +# Build ca_organic_amendment_properties and ca_organic_amendment_app_rate +# from the harmonized CSVs in this folder + +ca_organic_amendment_properties <- readr::read_csv( + file.path("data-raw", "ca_organic_amendment_properties.csv"), + show_col_types = FALSE +) + +ca_organic_amendment_app_rate <- readr::read_csv( + file.path("data-raw", "ca_organic_amendment_app_rate.csv"), + show_col_types = FALSE +) + +usethis::use_data(ca_organic_amendment_properties, overwrite = TRUE) +usethis::use_data(ca_organic_amendment_app_rate, overwrite = TRUE) diff --git a/modules/data.land/data-raw/create_compost_data.R b/modules/data.land/data-raw/create_compost_data.R deleted file mode 100644 index 24055aa5f90..00000000000 --- a/modules/data.land/data-raw/create_compost_data.R +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env Rscript - -# Build the ca_compost_amendment packaged dataset from the harmonized -# compost CSV produced by the fertilization harmonization script. - -ca_compost_amendment <- readr::read_csv( - file.path("data-raw", "compost_amendments.csv"), - col_types = readr::cols( - material = readr::col_character(), - cn_min = readr::col_double(), - cn_max = readr::col_double(), - cn_avg = readr::col_double(), - c_pct = readr::col_double(), - n_pct = readr::col_double(), - pan_pct = readr::col_double(), - n_class = readr::col_character(), - app_rate_min = readr::col_double(), - app_rate_max = readr::col_double(), - total_c_min_lbs_acre = readr::col_double(), - total_c_max_lbs_acre = readr::col_double(), - total_n_min_lbs_acre = readr::col_double(), - total_n_max_lbs_acre = readr::col_double(), - total_c_min_g_m2 = readr::col_double(), - total_c_max_g_m2 = readr::col_double(), - total_n_min_g_m2 = readr::col_double(), - total_n_max_g_m2 = readr::col_double(), - source = readr::col_character() - ) -) - -usethis::use_data(ca_compost_amendment, overwrite = TRUE) diff --git a/modules/data.land/data-raw/create_n_rate_data.R b/modules/data.land/data-raw/create_n_rate_data.R deleted file mode 100644 index b5a7b578567..00000000000 --- a/modules/data.land/data-raw/create_n_rate_data.R +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env Rscript - -# Build the ca_n_application_rate packaged dataset from the harmonized -# N application rate CSV produced by the fertilization harmonization -# script. The source CSV lives in the shared geo directory; a copy is -# kept here in data-raw/ for reproducibility. - -ca_n_application_rate <- readr::read_csv( - file.path("data-raw", "n_application_rates.csv"), - col_types = readr::cols( - pft_group = readr::col_character(), - crop = readr::col_character(), - min_n_lbs_acre = readr::col_double(), - max_n_lbs_acre = readr::col_double(), - source = readr::col_character(), - min_n_g_m2 = readr::col_double(), - max_n_g_m2 = readr::col_double() - ) -) - -usethis::use_data(ca_n_application_rate, overwrite = TRUE) diff --git a/modules/data.land/data/ca_compost_amendment.rda b/modules/data.land/data/ca_compost_amendment.rda deleted file mode 100644 index 9cf0091038a..00000000000 Binary files a/modules/data.land/data/ca_compost_amendment.rda and /dev/null differ diff --git a/modules/data.land/data/ca_n_application_rate.rda b/modules/data.land/data/ca_n_application_rate.rda index 9f93108526d..7caddb972c5 100644 Binary files a/modules/data.land/data/ca_n_application_rate.rda and b/modules/data.land/data/ca_n_application_rate.rda differ diff --git a/modules/data.land/data/ca_organic_amendment_app_rate.rda b/modules/data.land/data/ca_organic_amendment_app_rate.rda new file mode 100644 index 00000000000..1deabd87c5e Binary files /dev/null and b/modules/data.land/data/ca_organic_amendment_app_rate.rda differ diff --git a/modules/data.land/data/ca_organic_amendment_properties.rda b/modules/data.land/data/ca_organic_amendment_properties.rda new file mode 100644 index 00000000000..2377807fa17 Binary files /dev/null and b/modules/data.land/data/ca_organic_amendment_properties.rda differ diff --git a/modules/data.land/man/ca_compost_amendment.Rd b/modules/data.land/man/ca_compost_amendment.Rd deleted file mode 100644 index d9e8fda9ff4..00000000000 --- a/modules/data.land/man/ca_compost_amendment.Rd +++ /dev/null @@ -1,56 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{ca_compost_amendment} -\alias{ca_compost_amendment} -\title{California organic amendment (compost) properties} -\format{ -A tibble with 32 rows and the following columns: -\describe{ - \item{material}{\code{character}. Amendment material name.} - \item{cn_min, cn_max, cn_avg}{\code{numeric}. Carbon-to-nitrogen ratio - range and average.} - \item{c_pct}{\code{numeric}. Assumed carbon content (percent).} - \item{n_pct}{\code{numeric}. Total nitrogen content (percent).} - \item{pan_pct}{\code{numeric}. Plant-available nitrogen after 4 weeks - (percent). Negative values indicate N immobilization.} - \item{n_class}{\code{character}. "LOWER" or "HIGHER" N content class.} - \item{app_rate_min, app_rate_max}{\code{numeric}. Application rate range - (lbs/acre).} - \item{total_c_min_lbs_acre, total_c_max_lbs_acre}{\code{numeric}. - Total carbon applied (lbs C/acre).} - \item{total_n_min_lbs_acre, total_n_max_lbs_acre}{\code{numeric}. - Total nitrogen applied (lbs N/acre).} - \item{total_c_min_g_m2, total_c_max_g_m2}{\code{numeric}. - Total carbon in SI units (g C/m\eqn{^2}).} - \item{total_n_min_g_m2, total_n_max_g_m2}{\code{numeric}. - Total nitrogen in SI units (g N/m\eqn{^2}).} - \item{source}{\code{character}. Short citation for the data source.} -} -} -\source{ -Eghball, B. Composting Manure and Other Organic Residues. - University of Nebraska-Lincoln Extension, Publication G2222. - \url{https://extensionpubs.unl.edu/publication/g2222/na/html/view} - -Rynk, R. (ed.) Compost Production and Use in Sustainable - Farming Systems. NC State Extension. - \url{https://content.ces.ncsu.edu/compost-production-and-use-in-sustainable-farming-systems} -} -\usage{ -ca_compost_amendment -} -\description{ -Properties of organic amendment materials used in California agriculture, -including C:N ratios, carbon and nitrogen content, plant-available nitrogen -(PAN), and application rates. Some materials appear in multiple rows when -values are reported by different sources (e.g. Corn stalks, Cow manure, -Vegetable waste). The \code{source} column disambiguates these. -} -\seealso{ -\code{\link{look_up_ca_compost_amendment}} for looking up - amendments by material name. - \code{\link{look_up_fertilizer_components}} for fertilizer nutrient - composition (N/C fractions) from the SWAT/DayCent database. -} -\keyword{datasets} diff --git a/modules/data.land/man/ca_n_application_rate.Rd b/modules/data.land/man/ca_n_application_rate.Rd index 8c6b97d6dfe..99564a4fc5a 100644 --- a/modules/data.land/man/ca_n_application_rate.Rd +++ b/modules/data.land/man/ca_n_application_rate.Rd @@ -5,45 +5,46 @@ \alias{ca_n_application_rate} \title{California recommended N application rates by crop} \format{ -A tibble with one row per crop and the following columns: +A tibble with one row per crop and the columns: \describe{ - \item{pft_group}{\code{character}. Plant functional type group - (e.g. "row", "woody", "rice").} - \item{crop}{\code{character}. Crop name as given in the source.} - \item{min_n_lbs_acre}{\code{numeric}. Minimum recommended N rate - (lbs N/acre).} - \item{max_n_lbs_acre}{\code{numeric}. Maximum recommended N rate - (lbs N/acre).} - \item{source}{\code{character}. Short citation for the source(s). - Multiple sources are separated by "; ".} - \item{min_n_g_m2}{\code{numeric}. Minimum N rate in SI units - (g N/m\eqn{^2}). Conversion: 1 lb/acre = 0.112085 g/m\eqn{^2}.} - \item{max_n_g_m2}{\code{numeric}. Maximum N rate in SI units - (g N/m\eqn{^2}).} + \item{pft_group}{Plant functional type group: \code{"row"}, + \code{"woody"}, or \code{"rice"}.} + \item{crop}{Crop name as given in the source.} + \item{min_n_lbs_acre, max_n_lbs_acre}{Recommended N rate range + (lbs N / acre).} + \item{source}{Short citation. Multiple sources are joined with + \code{"; "}.} + \item{min_n_g_m2, max_n_g_m2}{Same range in SI units (g N / m\eqn{^2}).} } } \source{ -Rosenstock, T. S., Liptzin, D., Six, J., & Tomich, T. P. (2013). +Rosenstock, T. S., Liptzin, D., Six, J., Tomich, T. P. (2013). Nitrogen fertilizer use in California: Assessing the data, trends and a - way forward. California Agriculture, 67(1). + way forward. California Agriculture 67(1). \url{https://escholarship.org/uc/item/5mk2q1sm} -Meyer, R. D., Marcum, D. B., Orloff, S. B., & Schmierer, J. L. +Meyer, R. D., Marcum, D. B., Orloff, S. B., Schmierer, J. L. (2007). Alfalfa fertilization strategies. UC ANR Publication 8296. + +Brown, P. H. et al. (2020). Nitrogen Best Management Practices + for Almonds. Almond Board of California. Source for Almonds rates by + age. + +Lazicki, P., Geisseler, D., Horwath, W. R. (2016). Potato + Production in California. CDFA FREP / UC Davis. Source for Potato. } \usage{ ca_n_application_rate } \description{ -Crop-specific recommended nitrogen fertilizer application rates for -California agriculture. Contains total-season rates (not per-stage -breakdowns). When multiple sources report rates for the same crop, -the rate represents the envelope (min of minimums, max of maximums) -across sources. +Recommended nitrogen fertilizer application rates for California crops. +When multiple sources report rates for the same crop the value is the +envelope across sources. Crops reported only as within year stages +(Barley, Beans, Cauliflower, Melons) have stages summed to an annual +total. Crops reported only by age (Almonds) get the envelope across +ages. } \seealso{ -\code{\link{look_up_ca_n_rate}} for looking up rates by crop name. - \code{\link{look_up_fertilizer_components}} for fertilizer nutrient - composition (N/C fractions) from the SWAT/DayCent database. +\code{\link{look_up_ca_n_rate}}. } \keyword{datasets} diff --git a/modules/data.land/man/ca_organic_amendment_app_rate.Rd b/modules/data.land/man/ca_organic_amendment_app_rate.Rd new file mode 100644 index 00000000000..03692dc20c3 --- /dev/null +++ b/modules/data.land/man/ca_organic_amendment_app_rate.Rd @@ -0,0 +1,45 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{ca_organic_amendment_app_rate} +\alias{ca_organic_amendment_app_rate} +\title{California organic amendment application rates} +\format{ +A tibble with 64 rows (32 materials x 2 crop structures) and +the columns: +\describe{ + \item{material}{Material name. Joins to + \code{\link{ca_organic_amendment_properties}}.} + \item{crop_structure}{\code{"rows"} for annual row crops, + \code{"trees"} for perennial orchards.} + \item{app_rate_min, app_rate_max}{Amendment application rate range + (lbs of amendment / acre).} + \item{total_n_min_lbs_acre, total_n_max_lbs_acre}{Total N delivered + at those rates (lbs N / acre).} + \item{source}{Short citation.} + \item{total_n_min_g_m2, total_n_max_g_m2}{Same N range in SI units + (g N / m\eqn{^2}).} +} +} +\source{ +Eghball, B. Composting Manure and Other Organic Residues. + University of Nebraska Lincoln Extension, Publication G2222. + +Rynk, R. (ed.) Compost Production and Use in Sustainable + Farming Systems. NC State Extension. +} +\usage{ +ca_organic_amendment_app_rate +} +\description{ +Recommended application rates for each material in +\code{\link{ca_organic_amendment_properties}}, broken out by crop +structure (row crops vs orchards). The two rate sets are identical +for most materials in the source, but a handful of N rich materials +(Blood meal, poultry manure) differ between row and tree applications. +} +\seealso{ +\code{\link{ca_organic_amendment_properties}}. + \code{\link{look_up_ca_organic_amendment}}. +} +\keyword{datasets} diff --git a/modules/data.land/man/ca_organic_amendment_properties.Rd b/modules/data.land/man/ca_organic_amendment_properties.Rd new file mode 100644 index 00000000000..64077158c8e --- /dev/null +++ b/modules/data.land/man/ca_organic_amendment_properties.Rd @@ -0,0 +1,48 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{ca_organic_amendment_properties} +\alias{ca_organic_amendment_properties} +\title{California organic amendment properties} +\format{ +A tibble with 32 rows and the columns: +\describe{ + \item{material}{Material name.} + \item{material_class}{CalRecycle feedstock class + (14 CCR section 17852): one of \code{"ag"}, \code{"food"}, + \code{"green"}, \code{"wood"}, \code{"yard"}, \code{"biosolids"}.} + \item{cn_min, cn_max, cn_avg}{C:N ratio range.} + \item{n_pct}{Total N (percent of dry mass).} + \item{pan_pct}{Plant available N at 4 weeks (percent of total N). + Negative values indicate net immobilization.} + \item{n_class}{N tier reported in the source (\code{"LOWER"} or + \code{"HIGHER"}).} + \item{source}{Short citation.} +} +} +\source{ +Eghball, B. Composting Manure and Other Organic Residues. + University of Nebraska Lincoln Extension, Publication G2222. + \url{https://extensionpubs.unl.edu/publication/g2222/na/html/view} + +Rynk, R. (ed.) Compost Production and Use in Sustainable + Farming Systems. NC State Extension. + \url{https://content.ces.ncsu.edu/compost-production-and-use-in-sustainable-farming-systems} +} +\usage{ +ca_organic_amendment_properties +} +\description{ +Properties of organic amendment materials used in California +agriculture: C:N ratio range, total N, plant available N at 4 weeks +(PAN), and CalRecycle feedstock class (14 CCR section 17852). +Materials reported by more than one source appear once per source; +the \code{source} column disambiguates. Application rates live in +\code{\link{ca_organic_amendment_app_rate}} and join on +\code{material}. +} +\seealso{ +\code{\link{ca_organic_amendment_app_rate}}. + \code{\link{look_up_ca_organic_amendment}}. +} +\keyword{datasets} diff --git a/modules/data.land/man/look_up_ca_compost_amendment.Rd b/modules/data.land/man/look_up_ca_organic_amendment.Rd similarity index 69% rename from modules/data.land/man/look_up_ca_compost_amendment.Rd rename to modules/data.land/man/look_up_ca_organic_amendment.Rd index 677953772ed..8a54784a65e 100644 --- a/modules/data.land/man/look_up_ca_compost_amendment.Rd +++ b/modules/data.land/man/look_up_ca_organic_amendment.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/look_up_ca_n_rate.R -\name{look_up_ca_compost_amendment} -\alias{look_up_ca_compost_amendment} -\title{Look up California compost amendment properties} +\name{look_up_ca_organic_amendment} +\alias{look_up_ca_organic_amendment} +\title{Look up California organic amendment properties} \source{ Eghball, B. Composting Manure and Other Organic Residues. University of Nebraska-Lincoln Extension, Publication G2222. @@ -13,7 +13,7 @@ Rynk, R. (ed.) Compost Production and Use in Sustainable \url{https://content.ces.ncsu.edu/compost-production-and-use-in-sustainable-farming-systems} } \usage{ -look_up_ca_compost_amendment( +look_up_ca_organic_amendment( material, n_class = NULL, aggregate = c("none", "mean") @@ -28,15 +28,15 @@ look_up_ca_compost_amendment( If "mean", rows for the same material are averaged into a single row.} } \value{ -A tibble with columns: `material`, `cn_min`, `cn_max`, - `cn_avg`, `c_pct`, `n_pct`, `pan_pct`, `n_class`, - `total_c_min_g_m2`, `total_c_max_g_m2`, - `total_n_min_g_m2`, `total_n_max_g_m2`, `source`. +A tibble with columns: `material`, `material_class`, + `cn_min`, `cn_max`, `cn_avg`, `n_pct`, `pan_pct`, `n_class`, `source`. Returns an empty tibble (with a warning) if no match is found. } \description{ Returns properties of organic amendment materials including carbon and nitrogen content, C:N ratio, and plant-available nitrogen (PAN). +Application rates live in +\code{\link{ca_organic_amendment_app_rate}}; join on \code{material}. } \details{ Matching is case-insensitive. Exact matches are returned directly. @@ -47,13 +47,14 @@ Vegetable waste). Set `aggregate = "mean"` to collapse these into a single row per material using the mean of numeric columns. } \examples{ -look_up_ca_compost_amendment("Cow manure") -look_up_ca_compost_amendment("Cow manure", aggregate = "mean") -look_up_ca_compost_amendment("Poultry litter", n_class = "LOWER") +look_up_ca_organic_amendment("Cow manure") +look_up_ca_organic_amendment("Cow manure", aggregate = "mean") +look_up_ca_organic_amendment("Poultry litter", n_class = "LOWER") } \seealso{ [look_up_fertilizer_components()] for fertilizer nutrient composition (N/C fractions) from the SWAT/DayCent database. - [ca_compost_amendment] for the underlying dataset. + [ca_organic_amendment_properties] for the underlying dataset. + [ca_organic_amendment_app_rate] for the matching application rates. } diff --git a/modules/data.land/tests/testthat/test.look_up_ca_n_rate.R b/modules/data.land/tests/testthat/test.look_up_ca_n_rate.R index 0bf09d98852..955a3fae678 100644 --- a/modules/data.land/tests/testthat/test.look_up_ca_n_rate.R +++ b/modules/data.land/tests/testthat/test.look_up_ca_n_rate.R @@ -47,7 +47,7 @@ test_that("partial match suggests crops and returns empty result", { test_that("no match returns empty data frame with correct columns", { level <- PEcAn.logger::logger.getLevel() PEcAn.logger::logger.setLevel("OFF") - result <- look_up_ca_n_rate("Alfalfa") + result <- look_up_ca_n_rate("Soybean") PEcAn.logger::logger.setLevel(level) expect_equal(nrow(result), 0) expect_equal(names(result), c("pft_group", "crop", "min_n", "max_n", "source")) @@ -66,10 +66,10 @@ test_that("broccoli has multi-source citation", { expect_true(grepl("CDFA-FREP", result$source)) }) -# look_up_ca_compost_amendment tests +# look_up_ca_organic_amendment tests test_that("exact compost match returns correct properties", { - result <- look_up_ca_compost_amendment("Poultry litter") + result <- look_up_ca_organic_amendment("Poultry litter") expect_equal(nrow(result), 1) expect_equal(result$material, "Poultry litter") expect_equal(result$n_class, "LOWER") @@ -77,7 +77,7 @@ test_that("exact compost match returns correct properties", { }) test_that("duplicate materials return multiple rows", { - result <- look_up_ca_compost_amendment("Cow manure") + result <- look_up_ca_organic_amendment("Cow manure") expect_equal(nrow(result), 2) expect_true(all(result$material == "Cow manure")) expect_equal(sort(result$source), @@ -85,7 +85,7 @@ test_that("duplicate materials return multiple rows", { }) test_that("aggregate = mean collapses duplicate materials", { - result <- look_up_ca_compost_amendment("Cow manure", aggregate = "mean") + result <- look_up_ca_organic_amendment("Cow manure", aggregate = "mean") expect_equal(nrow(result), 1) expect_equal(result$material, "Cow manure") # cn_avg should be mean of 22.5 and 20.0 @@ -96,7 +96,7 @@ test_that("aggregate = mean collapses duplicate materials", { }) test_that("n_class filter works", { - result <- look_up_ca_compost_amendment("Blood meal", n_class = "HIGHER") + result <- look_up_ca_organic_amendment("Blood meal", n_class = "HIGHER") expect_equal(nrow(result), 1) expect_equal(result$n_class, "HIGHER") }) @@ -104,7 +104,7 @@ test_that("n_class filter works", { test_that("no compost match returns empty tibble with correct columns", { level <- PEcAn.logger::logger.getLevel() PEcAn.logger::logger.setLevel("OFF") - result <- look_up_ca_compost_amendment("Unicorn dust") + result <- look_up_ca_organic_amendment("Unicorn dust") PEcAn.logger::logger.setLevel(level) expect_equal(nrow(result), 0) expect_true("source" %in% names(result)) @@ -114,7 +114,7 @@ test_that("no compost match returns empty tibble with correct columns", { test_that("compost partial match suggests materials", { level <- PEcAn.logger::logger.getLevel() PEcAn.logger::logger.setLevel("OFF") - result <- look_up_ca_compost_amendment("manure") + result <- look_up_ca_organic_amendment("manure") PEcAn.logger::logger.setLevel(level) expect_equal(nrow(result), 0) }) @@ -123,14 +123,22 @@ test_that("compost partial match suggests materials", { test_that("ca_n_application_rate dataset has expected structure", { dat <- PEcAn.data.land::ca_n_application_rate - expect_equal(nrow(dat), 33) + expect_equal(nrow(dat), 40) expect_true(all(c("pft_group", "crop", "min_n_lbs_acre", "max_n_lbs_acre", "source", "min_n_g_m2", "max_n_g_m2") %in% names(dat))) }) -test_that("ca_compost_amendment dataset has expected structure", { - dat <- PEcAn.data.land::ca_compost_amendment +test_that("ca_organic_amendment_properties dataset has expected structure", { + dat <- PEcAn.data.land::ca_organic_amendment_properties expect_equal(nrow(dat), 32) expect_true("source" %in% names(dat)) expect_true(all(dat$n_class %in% c("LOWER", "HIGHER"))) }) + +test_that("ca_organic_amendment_app_rate dataset has expected structure", { + dat <- PEcAn.data.land::ca_organic_amendment_app_rate + expect_equal(nrow(dat), 64) + expect_true(all(c("material", "crop_structure", "app_rate_min", + "app_rate_max", "source") %in% names(dat))) + expect_true(all(dat$crop_structure %in% c("rows", "trees"))) +})