"0","# which items reported the thickness?"
"0","finding_engineered_wood_thickness <- DGT %R% ""/"" %R% DGT #%R% '"" ' "
"0","thickness_calc_extract <- str_extract_all(raw_data_summary_sheet$description, "
"0","                                          finding_engineered_wood_thickness, simplify = T) %>%"
"0","                           str_split(separators, n = 2, simplify = T)"
"0","thickness <- data.frame(thickness_calc_extract[1:length(raw_data_summary_sheet$description),1:2], stringsAsFactors = F)"
"0","thickness <- tibble(as.numeric(thickness[,1]) / as.numeric(thickness[,2]))"
"0","thickness$deconMaterialName <- weight_calc$deconMaterialName"
"0","# assign the default thickness to the rest of the items where thickness was not reported"
"0","thickness <- thickness %>% mutate(default_thickness = case_when("
"0","                              .$deconMaterialName == ""osb"" ~ 0.5,"
"0","                              .$deconMaterialName == ""plywood"" ~ 0.5)) %>%"
"0","                           left_join(default_material_dimensions, by = c(""deconMaterialName"" = ""description"")) %>%"
"0","                           add_column(dimension_product$sq_ft_dim) %>%"
"0","                           select(c(2, 1, 3, 5:7))"
"0","names(thickness) <- (c(""deconMaterialName"", ""reported_thickness"", ""default_thickness"", ""default_weight"", ""default_weight_units"", ""sq_ft_dim""))"
"0","# use the equation above to produce a new per_unit_value that gives the weight of a sheet of that product line item."
"0","thickness <- thickness %>% mutate(sheet_weight = ifelse(is.na(thickness$reported_thickness),"
"0","                                                      default_thickness * default_weight * sq_ft_dim,"
"0","                                                      reported_thickness * default_weight * sq_ft_dim"
"0","                           ))"
"0","weight_calc <- weight_calc %>% add_column(thickness$sheet_weight, .before = ""per_unit_value"") %>%"
"0","                              rename(sheet_weight = `thickness$sheet_weight`)"
"0","weight_calc <- weight_calc %>% mutate(per_unit_value = ifelse(is.na(sheet_weight),"
"0","                                                             per_unit_value,"
"0","                                                             sheet_weight)"
"0","                                     ) %>%"
"0","                              mutate(per_unit_value_units = ifelse(is.na(sheet_weight),"
"0","                                                             per_unit_value_units,"
"0","                                                             ""lbs per sheet"")"
"0","                                     ) #%>%"
"0","                              #select(-sheet_weight)"
"0","rm(separators)"
"0","rm(dimension_product)"
"0","rm(finding_engineered_wood_thickness)"
"0","rm(thickness_calc_extract)"
"0","rm(thickness)"
