"0","# this line preserves the raw data summary and creates an object with column order rearranged to facilitate creating an object whose variable transformations can be read from left to right columnwise    "
"0","material_dimensions_calc <- raw_data_summary_sheet %>%"
"0","   select(c( ""project"", ""contractor"", ""house_age"", ""house_size"", ""description"", ""notes"", ""deconMaterialName"", ""listed_quantity"", ""listed_units"", ""dimensions"", ""dimensional_units""))"
"0","# match up the converted square footage of materials to the raw_data_summary_sheet table; this takes care of most of the lumber line items"
"0","material_dimensions_calc <- material_dimensions_calc %>%"
"0","   mutate(per_unit_value = case_when("
"0","   .$listed_units == ""bd_ft"" ~ 1/12,"
"0","   .$listed_units == ""sq_ft"" ~ dimension_product$X1/12,"
"0","   .$listed_units == ""lin_ft"" ~ dimension_product$sq_ft_dim,"
"0","   .$description == ""cabinets"" & .$listed_units == ""count"" ~ 3,"
"0","   .$deconMaterialName == ""plywood"" ~ dimension_product$sq_dim,"
"0","   .$deconMaterialName == ""osb"" ~ dimension_product$sq_dim,"
"0","   .$deconMaterialName == ""carpeting"" ~ 100,"
"0","   .$description == ""corrugated sheetmetal"" ~ dimension_product$sq_ft_dim,"
"0","   .$description == ""angle iron"" ~  161.05)"
"0","   ) %>% "
"0","   mutate(per_unit_value_units = case_when("
"0","   .$listed_units == ""bd_ft"" ~ ""cu_ft_conversion"","
"0","   .$listed_units == ""sq_ft"" ~ ""ft thickness"","
"0","   .$description == ""cabinets"" & .$listed_units == ""count"" ~ ""lin_ft"","
"0","   .$listed_units == ""lin_ft"" ~ ""sq_ft"","
"0","   .$deconMaterialName == ""plywood"" ~ ""sq_ft"","
"0","   .$deconMaterialName == ""osb"" ~ ""sq_ft"","
"0","   .$deconMaterialName == ""carpeting"" ~ ""assumed_sq_ft_per_roll"","
"0","   .$description == ""corrugated sheetmetal"" ~ ""sq_ft"","
"0","   .$description == ""angle iron"" ~ ""kg"")"
"0","   )"
"0","# weight calculations table"
"0","weight_calc <- left_join(material_dimensions_calc, default_material_dimensions,  by = c(""description"", ""deconMaterialName""))"
"0","# clean up workspace, but don't remove dimension product just yet, as it will be needed later to calculate plywood & osb sheet weights"
"0","rm(material_dimensions_calc)"
