Skip to content

Commit

Permalink
Update dbh vs biomass
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolepore committed Mar 21, 2019
1 parent fd5fe22 commit 9f0a803
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions .buildignore/dbh-vs-biomass.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ Plot dbh vs. biomass by species
``` r
# Setup
library(tidyverse)
#> -- Attaching packages ------------------------------------------------ tidyverse 1.2.1 --
#> v ggplot2 3.1.0 v purrr 0.3.1
#> v tibble 2.0.1 v dplyr 0.8.0.1
#> v tidyr 0.8.3 v stringr 1.4.0
#> v readr 1.3.1 v forcats 0.4.0
#> Warning: package 'purrr' was built under R version 3.5.3
#> -- Conflicts --------------------------------------------------- tidyverse_conflicts() --
#> x dplyr::filter() masks stats::filter()
#> x dplyr::lag() masks stats::lag()
library(fgeo.biomass)
```

Expand Down Expand Up @@ -34,9 +43,9 @@ census_equations <- allo_find(census_species)
#> Assuming `dbh` in [mm] (required to find dbh-specific equations).
#> * Searching equations according to site and species.
#> Warning: Can't find equations matching these species:
#> acer sp, carya sp, crataegus sp, fraxinus sp, juniperus virginiana, quercus prinus, quercus sp, ulmus sp, unidentified unk
#> acer negundo, acer platanoides, acer sp, ailanthus altissima, asimina triloba, berberis thunbergii, carpinus caroliniana, carya sp, castanea dentata, celtis occidentalis, cercis canadensis, chionanthus virginicus, corylus americana, crataegus pruinosa, crataegus sp, diospyros virginiana, elaeagnus umbellata, fraxinus sp, ilex verticillata, juglans cinerea, juglans nigra, juniperus virginiana, lindera benzoin, paulownia tomentosa, quercus prinus, quercus sp, sambucus canadensis, ulmus sp, unidentified unk
#> * Refining equations according to dbh.
#> Warning: Can't find equations for 17132 rows (inserting `NA`).
#> Warning: Can't find equations for 21204 rows (inserting `NA`).
```

Notice the warning that equations couldn’t be found. This is in part
Expand All @@ -53,7 +62,7 @@ drop them.
census_equations %>%
filter(is.na(equation_id)) %>%
select(rowid, site, sp, equation_id)
#> # A tibble: 17,132 x 4
#> # A tibble: 21,204 x 4
#> rowid site sp equation_id
#> <int> <chr> <chr> <chr>
#> 1 1 scbi lindera benzoin <NA>
Expand All @@ -62,11 +71,11 @@ census_equations %>%
#> 4 4 scbi nyssa sylvatica <NA>
#> 5 5 scbi hamamelis virginiana <NA>
#> 6 7 scbi unidentified unk <NA>
#> 7 9 scbi viburnum prunifolium <NA>
#> 8 10 scbi asimina triloba <NA>
#> 9 11 scbi asimina triloba <NA>
#> 10 12 scbi asimina triloba <NA>
#> # ... with 17,122 more rows
#> 7 8 scbi lindera benzoin <NA>
#> 8 9 scbi viburnum prunifolium <NA>
#> 9 10 scbi asimina triloba <NA>
#> 10 11 scbi asimina triloba <NA>
#> # ... with 21,194 more rows

# Dropping useless rows to continue
census_equations2 <- census_equations %>%
Expand All @@ -84,20 +93,20 @@ biomass <- allo_evaluate(census_equations2)
#> object 'dba' not found
#> Warning: `biomass` may be invalid. This is still work in progress.
biomass
#> # A tibble: 14,049 x 2
#> # A tibble: 9,977 x 2
#> rowid biomass
#> <int> <dbl>
#> 1 6 NA
#> 2 8 5.69
#> 3 17 11.3
#> 4 21 231.
#> 5 22 10.3
#> 6 23 NA
#> 7 26 4.15
#> 8 29 469.
#> 9 34 3.44
#> 10 38 4.96
#> # ... with 14,039 more rows
#> 2 21 231.
#> 3 23 NA
#> 4 29 469.
#> 5 38 4.96
#> 6 69 NA
#> 7 72 349.
#> 8 81 NA
#> 9 84 126.
#> 10 88 NA
#> # ... with 9,967 more rows
```

We now learn that some equations couldn’t be evaluated. The problem now
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9f0a803

Please sign in to comment.