Skip to contents

Generates population data for generating model-assisted estimation. Plots that are totally nonsampled are excluded from estimation dataset. Next, an adjustment factor is calculated by strata (if MAmethod="PS") or by estimation unit to adjust for nonsampled (nonresponse) conditions that have proportion less than 1. Attributes adjusted to a per-acre value are summed by plot, divided by the adjustment factor, and averaged by stratum and/or estimation unit. Note: population data must be generated by MA method.

Usage

modMApop(
  popType = "VOL",
  popTabs = popTables(),
  popTabIDs = popTableIDs(),
  popFilter = popFilters(),
  pltassgn = NULL,
  pltassgnid = "PLT_CN",
  datsource = "sqlite",
  dsn = NULL,
  dbconn = NULL,
  pjoinid = "CN",
  areawt = "CONDPROP_UNADJ",
  adj = "plot",
  defaultVars = TRUE,
  unitvar = NULL,
  unitarea = NULL,
  areavar = "ACRES",
  unitzonal = NULL,
  prednames = NULL,
  predfac = NULL,
  standardize = TRUE,
  returndata = TRUE,
  savedata = FALSE,
  saveobj = FALSE,
  objnm = "MApopdat",
  unit_opts = NULL,
  savedata_opts = NULL,
  database_opts = NULL,
  MAdata = NULL,
  pltdat = NULL,
  auxdat = NULL,
  ...
)

Arguments

popType

String. Type of evaluation(s) to include in population data. Note: currently only c('CURR', 'VOL', 'LULC') are available. See details below for descriptions of each.

popTabs

List of population tables the user would like returned. See help(popTables) for a list of options.

popTabIDs

List of unique IDs corresponding to the population tables that the user has requested. See help(popTableIDs) for a list of options.

popFilter

List of population filters. See help(popFilters) for a list of options.

pltassgn

DF/DT, Optional. R object, sf R object, comma-delimited file(.csv), layer or spatial layer in dsn, or shapefile(.shp). Plot-level assignment of estimation unit and/or strata, with one record for each plot.

pltassgnid

String.

datsource

String. Name of data source ('obj', 'sqlite', 'postgres').

dsn

String. Name of database where tree, cond, and plot-level tables reside. The dsn varies by driver. See gdal OGR vector formats (https://www.gdal.org/ogr_formats.html).

dbconn

Open database connection.

pjoinid

String. Join variable in plot to match pltassgnid. Does not need to be uniqueid. If using most current XY coordinates for plot assignments, use identifier for plot (e.g., PLOT_ID).

areawt

String. Name of variable for summarizing area weights (e.g., CONDPROP_UNADJ).

adj

String. How to calculate adjustment factors for nonsampled (nonresponse) conditions based on summed proportions for by plot ('samp', 'plot', 'none'). 'samp' - adjustments are calculated at strata/estimation unit level; 'plot' - adjustments are calculated at plot-level. Adjustments are only calculated for annual inventory plots (DESIGNCD=1).

defaultVars

Logical. If TRUE, a set of default variables are selected.

unitvar

String. Name of the estimation unit variable in unitarea and cond or pltassgn data frame with estimation unit assignment for each plot (e.g., 'ESTN_UNIT'). Optional if only one estimation unit.

unitarea

Numeric or DF. Total area by estimation unit. If only 1 estimation unit, include number of total acreage for the area of interest or a data frame with area and estimation unit. If more than one estimation unit, provide a data frame of total area by estimation unit, including unitvar and areavar.

areavar

String. Name of area variable in unitarea. Default="ACRES".

unitzonal

DF/DT. Table with zonal auxiliary information by estimation unit. For continuous data, means by estimation unit; for categorical data, proportion of class by estimation unit.

prednames

String vector. Name(s) of predictor variables to include in model.

predfac

String vector. Name(s) of prednames that are factors (i.e., categorical). Names will change in output depending on number of categories.

standardize

Logical. If TRUE, predictors are standardized.

returndata

Logical. If TRUE, returns data objects.

savedata

Logical. If TRUE, saves table(s) to outfolder.

saveobj

Logical. If TRUE, saves returned list object to outfolder.

objnm

String. Name of *.rds object.

unit_opts

List. See help(unit_options()) for a list of options.

savedata_opts

List. See help(savedata_options()) for a list of options. Only used when savedata = TRUE.

database_opts

List. See help(database_options()) for a list of options. Only used when datsource = 'postgres'.

MAdata

List. Data output from FIESTA::MAdata().

pltdat

R List object. Output data list components from FIESTA::spGetPlots().

auxdat

List. Auxiliary data output from FIESTA::spGetAuxiliary().

...

For extendibility.

Value

A list with population data for Green-Book estimates.

condx

Data frame. Condition-level data including plot-level assignment of estimation unit and stratum (if strata=TRUE) and adjusted condition proportion.

pltcondx

Data frame. Condition-level data, merged with plot data.

cuniqueid

String. Unique identifier of plot in condx and pltcondx.

condid

String. Unique identifier of condition in condx and pltcondx.

treex

Data frame. If esttype='TREE', tree-level data, including sample adjustment factor.

tuniqueid

String. If esttype='TREE', unique identifier of plot in treex.

ACI.filter

String. If ACI=FALSE, ACI.filter="COND_STATUS_CD == 1" .

unitarea

String. Returned table of area by estimation unit.

unitvar

String. Variable name for estimation unit.

expcondtab

String. If ACI=FALSE, ACI.filter="COND_STATUS_CD == 1".

plotsampcnt

Data frame. Number of plots by PLOT_STATUS_CD.

condsampcnt

Data frame. Number of conditions by COND_STATUS_CD.

states

String. State names in dataset.

invyrs

String. Range of inventory years in dataset.

VariableDescription
unitvarestimation unit
n.totalnumber of plots for estimation unit
CONDPROP_UNADJ_SUMsummed condition proportion by strata and estimation unit
CONDPROP_ADJFACadjusted condition proportion by strata after nonsampled plots removed
AREA_USEDtotal area of estimation unit
expfacstrata-level expansion factor after nonsampled plots and conditions removed (AREA_USED/n.strata)
EXPNSstrata-level area expansions (expfac * strwt)

Table(s) are also written to outfolder.

Details

If variables are NULL, then it will prompt user to input variables.

Necessary variables:

DataVariableDescription
treetuniqueidUnique identifier for each plot, to link to pltassgn (e.g. PLT_CN).
CONDIDUnique identifier of each condition on plot, to link to cond. Set CONDID=1, if only 1 condition per plot.
TPA_UNADJNumber of trees per acre each sample tree represents (e.g. DESIGNCD=1: TPA_UNADJ=6.018046 for trees on subplot; 74.965282 for trees on microplot).
condcuniqueidUnique identifier for each plot, to link to pltassgn (e.g. PLT_CN).
CONDIDUnique identifier of each condition on plot. Set CONDID=1, if only 1 condition per plot.
CONDPROP_UNADJUnadjusted proportion of condition on each plot. Set CONDPROP_UNADJ=1, if only 1 condition per plot.
COND_STATUS_CDStatus of each forested condition on plot (i.e. accessible forest, nonforest, water, etc.)
NF_COND_STATUS_CDIf ACI=TRUE. Status of each nonforest condition on plot (i.e. accessible nonforest, nonsampled nonforest)
SITECLCDIf landarea=TIMBERLAND. Measure of site productivity.
RESERVCDIf landarea=TIMBERLAND. Reserved status.
SUBPROP_UNADJUnadjusted proportion of subplot conditions on each plot. Set SUBPROP_UNADJ=1, if only 1 condition per subplot.
MICRPROP_UNADJIf microplot tree attributes. Unadjusted proportion of microplot conditions on each plot. Set MICRPROP_UNADJ=1, if only 1 condition per microplot.
MACRPROP_UNADJIf macroplot tree attributes. Unadjusted proportion of macroplot conditions on each plot. Set MACRPROP_UNADJ=1, if only 1 condition per macroplot.
pltassgnpuniqueidUnique identifier for each plot, to link to cond (e.g. CN).
STATECDIdentifies state each plot is located in.
INVYRIdentifies inventory year of each plot.
PLOT_STATUS_CDStatus of each plot (i.e. sampled, nonsampled). If not included, all plots are assumed as sampled.

For available reference tables: sort(unique(FIESTAutils::ref_codes$VARIABLE))

Note

ADJUSTMENT FACTOR:
The adjustment factor is necessary to account for nonsampled conditions. It is calculated for each estimation unit by strata. by summing the unadjusted proportions of the subplot, microplot, and macroplot (i.e. *PROP_UNADJ) and dividing by the number of plots in the strata/estimation unit).

An adjustment factor is determined for each tree based on the size of the plot it was measured on. This is identified using TPA_UNADJ as follows:

PLOT SIZETPA_UNADJ
SUBPLOT6.018046
MICROPLOT74.965282
MACROPLOT0.999188

If ACI=FALSE, only nonsampled forest conditions are accounted for in the adjustment factor.
If ACI=TRUE, the nonsampled nonforest conditions are removed as well and accounted for in adjustment factor. This is if you are interested in estimates for all lands or nonforest lands in the All-Condition-Inventory.

unitcombine:
If TRUE and less than 2 plots in any one estimation unit, all estimation units with 10 or less plots are combined. The current method for combining is to group the estimation unit with less than 10 plots with the estimation unit following in consecutive order (numeric or alphabetical), restrained by survey unit (UNITCD) if included in dataset, and continuing until the number of plots equals 10. If there are no estimation units following in order, it is combined with the estimation unit previous in order.

stratcombine:
If TRUE and less than 2 plots in any one strata class within an estimation unit, all strata classes with 2 or less plots are combined. The current method for combining is to group the strata with less than 2 plots with the strata class following in consecutive order (numeric or alphabetical), restrained by estimation unit (if unitcombine=FALSE), and continuing until the number of plots equals 10. If there are no strata classes following in order, it is combined with the estimation unit previous in order.

References

Scott, Charles T.; Bechtold, William A.; Reams, Gregory A.; Smith, William D.; Westfall, James A.; Hansen, Mark H.; Moisen, Gretchen G. 2005. Sample-based estimators used by the Forest Inventory and Analysis national information management system. Gen. Tech. Rep. SRS-80. Asheville, NC: U.S. Department of Agriculture, Forest Service, Southern Research Station, p.53-77.

Author

Tracey S. Frescino, Paul L. Patterson

Examples

# \donttest{
# NOTE: FIA data objects used in these examples are stored in `FIESTA`, but
# can be generated for populations of interest by the user with functions in
# `FIESTA` such as `spGetPlots()`, `spGetAuxiliary()`, etc. For more
# information, see `FIESTA`'s extensive vignettes.
 
# Population data for counties in Wyoming
modMApop(popTabs = list(tree = FIESTA::WYtree,
                        cond = FIESTA::WYcond),
         pltassgn = FIESTA::WYpltassgn,
         pltassgnid = "CN",
         unitarea = FIESTA::WYunitarea,
         unitvar = "ESTN_UNIT",
         unitzonal = FIESTA::WYunitzonal,
         prednames = c("dem", "tcc", "tpi", "tnt"),
         predfac = "tnt")
#> variables are missing from dataset: STATECD, UNITCD, COUNTYCD, PLOT, PLOT_STATUS_CD, PLOT_NONSAMPLE_REASN_CD, INTENSITY, SUBCYCLE, MACRO_BREAKPOINT_DIA
#> SURVEY table does not exist in database... assuming annual inventory plots
#> INVYR not in input data...  no invyrs returned...
#> SUBCYCLE not in data... assuming all SUBCYCLE <> 99
#> removing nonsampled forest plots...
#> returning data needed for estimation...
#> there are 14 nonsampled conditions
#> $module
#> [1] "MA"
#> 
#> $popType
#> [1] "VOL"
#> 
#> $pltidsadj
#> Key: <CN>
#>                   CN ADJ_FACTOR_COND ADJ_FACTOR_SUBP ADJ_FACTOR_MACR
#>               <char>           <num>           <num>           <int>
#>    1: 40404728010690               1               1               0
#>    2: 40404729010690               1               1               0
#>    3: 40404730010690               1               1               0
#>    4: 40404731010690               1               1               0
#>    5: 40404733010690               1               1               0
#>   ---                                                               
#> 3043: 40407866010690               1               1               0
#> 3044: 40407867010690               1               1               0
#> 3045: 40407868010690               1               1               0
#> 3046: 40407869010690               1               1               0
#> 3047: 46792188020004               1               1               0
#>       ADJ_FACTOR_MICR
#>                 <num>
#>    1:               1
#>    2:               1
#>    3:               1
#>    4:               1
#>    5:               1
#>   ---                
#> 3043:               1
#> 3044:               1
#> 3045:               1
#> 3046:               1
#> 3047:               1
#> 
#> $pltcondx
#> Key: <PLT_CN, CONDID>
#>               PLT_CN CONDID COND_NONSAMPLE_REASN_CD CONDPROP_UNADJ
#>               <char>  <int>                   <int>          <num>
#>    1: 40404728010690      1                      NA              1
#>    2: 40404729010690      1                      NA              1
#>    3: 40404730010690      1                      NA              1
#>    4: 40404731010690      1                      NA              1
#>    5: 40404733010690      1                      NA              1
#>   ---                                                             
#> 3220: 40407866010690      1                      NA              1
#> 3221: 40407867010690      1                      NA              1
#> 3222: 40407868010690      1                      NA              1
#> 3223: 40407869010690      1                      NA              1
#> 3224: 46792188020004      1                      NA              1
#>       SUBPPROP_UNADJ MICRPROP_UNADJ MACRPROP_UNADJ OWNCD OWNGRPCD RESERVCD
#>                <num>          <num>         <lgcl> <int>    <int>    <int>
#>    1:              1              1             NA    46       40        0
#>    2:              1              1             NA    46       40        0
#>    3:              1              1             NA    11       10        0
#>    4:              1              1             NA    22       20        0
#>    5:              1              1             NA    46       40        0
#>   ---                                                                     
#> 3220:              1              1             NA    46       40        0
#> 3221:              1              1             NA    46       40        0
#> 3222:              1              1             NA    12       10        0
#> 3223:              1              1             NA    46       40        0
#> 3224:              1              1             NA    11       10        1
#>       SITECLCD STDORGCD ADFORCD LIVE_CANOPY_CVR_PCT COND_STATUS_CD
#>          <int>    <int>   <int>               <int>          <int>
#>    1:       NA       NA      NA                   0              2
#>    2:        7        0      NA                  17              1
#>    3:        6        0     206                  41              1
#>    4:       NA       NA      NA                   0              2
#>    5:       NA       NA      NA                   0              2
#>   ---                                                             
#> 3220:       NA       NA      NA                   0              2
#> 3221:       NA       NA      NA                   0              2
#> 3222:       NA       NA     206                   1              2
#> 3223:       NA       NA      NA                   0              2
#> 3224:        6        0     214                  48              1
#>       NF_COND_STATUS_CD FORTYPCD STDSZCD STDAGE GSSTKCD DSTRBCD1 DSTRBYR1
#>                   <int>    <int>   <int>  <int>   <int>    <int>    <int>
#>    1:                NA       NA      NA     NA      NA       NA       NA
#>    2:                NA      366       1     46       5        0       NA
#>    3:                NA      201       1    220       3        0       NA
#>    4:                NA       NA      NA     NA      NA       NA       NA
#>    5:                NA       NA      NA     NA      NA       NA       NA
#>   ---                                                                    
#> 3220:                NA       NA      NA     NA      NA       NA       NA
#> 3221:                NA       NA      NA     NA      NA       NA       NA
#> 3222:                NA       NA      NA     NA      NA       NA       NA
#> 3223:                NA       NA      NA     NA      NA       NA       NA
#> 3224:                NA      201       1    109       3        0       NA
#>       DSTRBCD2 DSTRBYR2 FORTYPGRPCD TOTAL LANDSTATUSCD
#>          <int>    <int>       <num> <int>        <num>
#>    1:       NA       NA          NA     1           NA
#>    2:        0       NA         360     1            2
#>    3:        0       NA         200     1            1
#>    4:       NA       NA          NA     1           NA
#>    5:       NA       NA          NA     1           NA
#>   ---                                                 
#> 3220:       NA       NA          NA     1           NA
#> 3221:       NA       NA          NA     1           NA
#> 3222:       NA       NA          NA     1           NA
#> 3223:       NA       NA          NA     1           NA
#> 3224:        0       NA         200     1            3
#>                         LANDSTATUSNM DSTRBGRP
#>                               <char>   <char>
#>    1:                           <NA>     <NA>
#>    2:               Other forestland        0
#>    3:                     Timberland        0
#>    4:                           <NA>     <NA>
#>    5:                           <NA>     <NA>
#>   ---                                        
#> 3220:                           <NA>     <NA>
#> 3221:                           <NA>     <NA>
#> 3222:                           <NA>     <NA>
#> 3223:                           <NA>     <NA>
#> 3224: Reserved productive forestland        0
#> 
#> $pltcondflds
#>  [1] "PLT_CN"                  "CONDID"                 
#>  [3] "COND_NONSAMPLE_REASN_CD" "CONDPROP_UNADJ"         
#>  [5] "SUBPPROP_UNADJ"          "MICRPROP_UNADJ"         
#>  [7] "MACRPROP_UNADJ"          "OWNCD"                  
#>  [9] "OWNGRPCD"                "RESERVCD"               
#> [11] "SITECLCD"                "STDORGCD"               
#> [13] "ADFORCD"                 "LIVE_CANOPY_CVR_PCT"    
#> [15] "COND_STATUS_CD"          "NF_COND_STATUS_CD"      
#> [17] "FORTYPCD"                "STDSZCD"                
#> [19] "STDAGE"                  "GSSTKCD"                
#> [21] "DSTRBCD1"                "DSTRBYR1"               
#> [23] "DSTRBCD2"                "DSTRBYR2"               
#> [25] "FORTYPGRPCD"             "LANDSTATUSCD"           
#> [27] "LANDSTATUSNM"            "DSTRBGRP"               
#> 
#> $pjoinid
#> [1] "CN"
#> 
#> $cuniqueid
#> [1] "PLT_CN"
#> 
#> $pltassgnid
#> [1] "CN"
#> 
#> $condid
#> [1] "CONDID"
#> 
#> $ACI
#> [1] FALSE
#> 
#> $areawt
#> [1] "CONDPROP_UNADJ"
#> 
#> $areawt2
#> NULL
#> 
#> $adjcase
#>              COND 
#> "ADJ_FACTOR_COND" 
#> 
#> $dbqueries
#> $dbqueries$adjfactors
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3)\n-------------------------------------------\nSELECT pltids.CN,\n   COALESCE(1 / NULLIF(SUM(CONDPROP_UNADJ),0), 0) AS ADJ_FACTOR_COND,\n   COALESCE(1 / NULLIF(SUM(SUBPPROP_UNADJ),0), 0) AS ADJ_FACTOR_SUBP,\n   COALESCE(1 / NULLIF(SUM(MACRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MACR,\n   COALESCE(1 / NULLIF(SUM(MICRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MICR\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)\n WHERE c.COND_STATUS_CD <> 5\n GROUP BY pltids.CN"
#> 
#> $dbqueries$pltidsadj
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3)\nSELECT pltids.CN,\n   COALESCE(1 / NULLIF(SUM(CONDPROP_UNADJ),0), 0) AS ADJ_FACTOR_COND,\n   COALESCE(1 / NULLIF(SUM(SUBPPROP_UNADJ),0), 0) AS ADJ_FACTOR_SUBP,\n   COALESCE(1 / NULLIF(SUM(MACRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MACR,\n   COALESCE(1 / NULLIF(SUM(MICRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MICR\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)\n WHERE c.COND_STATUS_CD <> 5\n GROUP BY pltids.CN"
#> 
#> $dbqueries$pltcondx
#> [1] "SELECT c.PLT_CN, c.CONDID, c.COND_NONSAMPLE_REASN_CD, c.CONDPROP_UNADJ, c.SUBPPROP_UNADJ, c.MICRPROP_UNADJ, c.MACRPROP_UNADJ, c.OWNCD, c.OWNGRPCD, c.RESERVCD, c.SITECLCD, c.STDORGCD, c.ADFORCD, c.LIVE_CANOPY_CVR_PCT, c.COND_STATUS_CD, c.NF_COND_STATUS_CD, c.FORTYPCD, c.STDSZCD, c.STDAGE, c.GSSTKCD, c.DSTRBCD1, c.DSTRBYR1, c.DSTRBCD2, c.DSTRBYR2, \n   (CASE\n   WHEN c.FORTYPCD = 100 THEN '100'\n   WHEN c.FORTYPCD = 101 THEN '100'\n   WHEN c.FORTYPCD = 102 THEN '100'\n   WHEN c.FORTYPCD = 103 THEN '100'\n   WHEN c.FORTYPCD = 104 THEN '100'\n   WHEN c.FORTYPCD = 105 THEN '100'\n   WHEN c.FORTYPCD = 120 THEN '120'\n   WHEN c.FORTYPCD = 121 THEN '120'\n   WHEN c.FORTYPCD = 122 THEN '120'\n   WHEN c.FORTYPCD = 123 THEN '120'\n   WHEN c.FORTYPCD = 124 THEN '120'\n   WHEN c.FORTYPCD = 125 THEN '120'\n   WHEN c.FORTYPCD = 126 THEN '120'\n   WHEN c.FORTYPCD = 127 THEN '120'\n   WHEN c.FORTYPCD = 128 THEN '120'\n   WHEN c.FORTYPCD = 129 THEN '120'\n   WHEN c.FORTYPCD = 140 THEN '140'\n   WHEN c.FORTYPCD = 141 THEN '140'\n   WHEN c.FORTYPCD = 142 THEN '140'\n   WHEN c.FORTYPCD = 150 THEN '150'\n   WHEN c.FORTYPCD = 151 THEN '150'\n   WHEN c.FORTYPCD = 160 THEN '160'\n   WHEN c.FORTYPCD = 161 THEN '160'\n   WHEN c.FORTYPCD = 162 THEN '160'\n   WHEN c.FORTYPCD = 163 THEN '160'\n   WHEN c.FORTYPCD = 164 THEN '160'\n   WHEN c.FORTYPCD = 165 THEN '160'\n   WHEN c.FORTYPCD = 166 THEN '160'\n   WHEN c.FORTYPCD = 167 THEN '160'\n   WHEN c.FORTYPCD = 168 THEN '160'\n   WHEN c.FORTYPCD = 170 THEN '170'\n   WHEN c.FORTYPCD = 171 THEN '170'\n   WHEN c.FORTYPCD = 172 THEN '170'\n   WHEN c.FORTYPCD = 180 THEN '180'\n   WHEN c.FORTYPCD = 181 THEN '180'\n   WHEN c.FORTYPCD = 182 THEN '180'\n   WHEN c.FORTYPCD = 183 THEN '180'\n   WHEN c.FORTYPCD = 184 THEN '180'\n   WHEN c.FORTYPCD = 185 THEN '180'\n   WHEN c.FORTYPCD = 200 THEN '200'\n   WHEN c.FORTYPCD = 201 THEN '200'\n   WHEN c.FORTYPCD = 202 THEN '200'\n   WHEN c.FORTYPCD = 203 THEN '200'\n   WHEN c.FORTYPCD = 220 THEN '220'\n   WHEN c.FORTYPCD = 221 THEN '220'\n   WHEN c.FORTYPCD = 222 THEN '220'\n   WHEN c.FORTYPCD = 223 THEN '220'\n   WHEN c.FORTYPCD = 224 THEN '220'\n   WHEN c.FORTYPCD = 225 THEN '220'\n   WHEN c.FORTYPCD = 226 THEN '220'\n   WHEN c.FORTYPCD = 240 THEN '240'\n   WHEN c.FORTYPCD = 241 THEN '240'\n   WHEN c.FORTYPCD = 260 THEN '260'\n   WHEN c.FORTYPCD = 261 THEN '260'\n   WHEN c.FORTYPCD = 262 THEN '260'\n   WHEN c.FORTYPCD = 263 THEN '260'\n   WHEN c.FORTYPCD = 264 THEN '260'\n   WHEN c.FORTYPCD = 265 THEN '260'\n   WHEN c.FORTYPCD = 266 THEN '260'\n   WHEN c.FORTYPCD = 267 THEN '260'\n   WHEN c.FORTYPCD = 268 THEN '260'\n   WHEN c.FORTYPCD = 269 THEN '260'\n   WHEN c.FORTYPCD = 270 THEN '260'\n   WHEN c.FORTYPCD = 271 THEN '260'\n   WHEN c.FORTYPCD = 280 THEN '280'\n   WHEN c.FORTYPCD = 281 THEN '280'\n   WHEN c.FORTYPCD = 300 THEN '300'\n   WHEN c.FORTYPCD = 301 THEN '300'\n   WHEN c.FORTYPCD = 304 THEN '300'\n   WHEN c.FORTYPCD = 305 THEN '300'\n   WHEN c.FORTYPCD = 320 THEN '320'\n   WHEN c.FORTYPCD = 321 THEN '320'\n   WHEN c.FORTYPCD = 340 THEN '340'\n   WHEN c.FORTYPCD = 341 THEN '340'\n   WHEN c.FORTYPCD = 342 THEN '340'\n   WHEN c.FORTYPCD = 360 THEN '360'\n   WHEN c.FORTYPCD = 361 THEN '360'\n   WHEN c.FORTYPCD = 362 THEN '360'\n   WHEN c.FORTYPCD = 363 THEN '360'\n   WHEN c.FORTYPCD = 364 THEN '360'\n   WHEN c.FORTYPCD = 365 THEN '360'\n   WHEN c.FORTYPCD = 366 THEN '360'\n   WHEN c.FORTYPCD = 367 THEN '360'\n   WHEN c.FORTYPCD = 368 THEN '360'\n   WHEN c.FORTYPCD = 369 THEN '360'\n   WHEN c.FORTYPCD = 370 THEN '370'\n   WHEN c.FORTYPCD = 371 THEN '370'\n   WHEN c.FORTYPCD = 380 THEN '380'\n   WHEN c.FORTYPCD = 381 THEN '380'\n   WHEN c.FORTYPCD = 382 THEN '380'\n   WHEN c.FORTYPCD = 383 THEN '380'\n   WHEN c.FORTYPCD = 384 THEN '380'\n   WHEN c.FORTYPCD = 385 THEN '380'\n   WHEN c.FORTYPCD = 390 THEN '390'\n   WHEN c.FORTYPCD = 391 THEN '390'\n   WHEN c.FORTYPCD = 400 THEN '400'\n   WHEN c.FORTYPCD = 401 THEN '400'\n   WHEN c.FORTYPCD = 402 THEN '400'\n   WHEN c.FORTYPCD = 403 THEN '400'\n   WHEN c.FORTYPCD = 404 THEN '400'\n   WHEN c.FORTYPCD = 405 THEN '400'\n   WHEN c.FORTYPCD = 406 THEN '400'\n   WHEN c.FORTYPCD = 407 THEN '400'\n   WHEN c.FORTYPCD = 409 THEN '400'\n   WHEN c.FORTYPCD = 500 THEN '500'\n   WHEN c.FORTYPCD = 501 THEN '500'\n   WHEN c.FORTYPCD = 502 THEN '500'\n   WHEN c.FORTYPCD = 503 THEN '500'\n   WHEN c.FORTYPCD = 504 THEN '500'\n   WHEN c.FORTYPCD = 505 THEN '500'\n   WHEN c.FORTYPCD = 506 THEN '500'\n   WHEN c.FORTYPCD = 507 THEN '500'\n   WHEN c.FORTYPCD = 508 THEN '500'\n   WHEN c.FORTYPCD = 509 THEN '500'\n   WHEN c.FORTYPCD = 510 THEN '500'\n   WHEN c.FORTYPCD = 511 THEN '500'\n   WHEN c.FORTYPCD = 512 THEN '500'\n   WHEN c.FORTYPCD = 513 THEN '500'\n   WHEN c.FORTYPCD = 514 THEN '500'\n   WHEN c.FORTYPCD = 515 THEN '500'\n   WHEN c.FORTYPCD = 516 THEN '500'\n   WHEN c.FORTYPCD = 517 THEN '500'\n   WHEN c.FORTYPCD = 519 THEN '500'\n   WHEN c.FORTYPCD = 520 THEN '500'\n   WHEN c.FORTYPCD = 600 THEN '600'\n   WHEN c.FORTYPCD = 601 THEN '600'\n   WHEN c.FORTYPCD = 602 THEN '600'\n   WHEN c.FORTYPCD = 605 THEN '600'\n   WHEN c.FORTYPCD = 606 THEN '600'\n   WHEN c.FORTYPCD = 607 THEN '600'\n   WHEN c.FORTYPCD = 608 THEN '600'\n   WHEN c.FORTYPCD = 609 THEN '600'\n   WHEN c.FORTYPCD = 700 THEN '700'\n   WHEN c.FORTYPCD = 701 THEN '700'\n   WHEN c.FORTYPCD = 702 THEN '700'\n   WHEN c.FORTYPCD = 703 THEN '700'\n   WHEN c.FORTYPCD = 704 THEN '700'\n   WHEN c.FORTYPCD = 705 THEN '700'\n   WHEN c.FORTYPCD = 706 THEN '700'\n   WHEN c.FORTYPCD = 707 THEN '700'\n   WHEN c.FORTYPCD = 708 THEN '700'\n   WHEN c.FORTYPCD = 709 THEN '700'\n   WHEN c.FORTYPCD = 722 THEN '700'\n   WHEN c.FORTYPCD = 800 THEN '800'\n   WHEN c.FORTYPCD = 801 THEN '800'\n   WHEN c.FORTYPCD = 802 THEN '800'\n   WHEN c.FORTYPCD = 803 THEN '800'\n   WHEN c.FORTYPCD = 805 THEN '800'\n   WHEN c.FORTYPCD = 807 THEN '800'\n   WHEN c.FORTYPCD = 809 THEN '800'\n   WHEN c.FORTYPCD = 900 THEN '900'\n   WHEN c.FORTYPCD = 901 THEN '900'\n   WHEN c.FORTYPCD = 902 THEN '900'\n   WHEN c.FORTYPCD = 903 THEN '900'\n   WHEN c.FORTYPCD = 904 THEN '900'\n   WHEN c.FORTYPCD = 905 THEN '900'\n   WHEN c.FORTYPCD = 910 THEN '910'\n   WHEN c.FORTYPCD = 911 THEN '910'\n   WHEN c.FORTYPCD = 912 THEN '910'\n   WHEN c.FORTYPCD = 920 THEN '920'\n   WHEN c.FORTYPCD = 921 THEN '920'\n   WHEN c.FORTYPCD = 922 THEN '920'\n   WHEN c.FORTYPCD = 923 THEN '920'\n   WHEN c.FORTYPCD = 924 THEN '920'\n   WHEN c.FORTYPCD = 925 THEN '920'\n   WHEN c.FORTYPCD = 926 THEN '920'\n   WHEN c.FORTYPCD = 931 THEN '920'\n   WHEN c.FORTYPCD = 932 THEN '920'\n   WHEN c.FORTYPCD = 933 THEN '920'\n   WHEN c.FORTYPCD = 934 THEN '920'\n   WHEN c.FORTYPCD = 935 THEN '920'\n   WHEN c.FORTYPCD = 940 THEN '940'\n   WHEN c.FORTYPCD = 941 THEN '940'\n   WHEN c.FORTYPCD = 942 THEN '940'\n   WHEN c.FORTYPCD = 943 THEN '940'\n   WHEN c.FORTYPCD = 950 THEN '950'\n   WHEN c.FORTYPCD = 951 THEN '950'\n   WHEN c.FORTYPCD = 952 THEN '950'\n   WHEN c.FORTYPCD = 953 THEN '950'\n   WHEN c.FORTYPCD = 954 THEN '950'\n   WHEN c.FORTYPCD = 955 THEN '950'\n   WHEN c.FORTYPCD = 960 THEN '960'\n   WHEN c.FORTYPCD = 961 THEN '960'\n   WHEN c.FORTYPCD = 962 THEN '960'\n   WHEN c.FORTYPCD = 970 THEN '970'\n   WHEN c.FORTYPCD = 971 THEN '970'\n   WHEN c.FORTYPCD = 972 THEN '970'\n   WHEN c.FORTYPCD = 973 THEN '970'\n   WHEN c.FORTYPCD = 974 THEN '970'\n   WHEN c.FORTYPCD = 975 THEN '970'\n   WHEN c.FORTYPCD = 976 THEN '970'\n   WHEN c.FORTYPCD = 980 THEN '980'\n   WHEN c.FORTYPCD = 981 THEN '980'\n   WHEN c.FORTYPCD = 982 THEN '980'\n   WHEN c.FORTYPCD = 983 THEN '980'\n   WHEN c.FORTYPCD = 984 THEN '980'\n   WHEN c.FORTYPCD = 985 THEN '980'\n   WHEN c.FORTYPCD = 986 THEN '980'\n   WHEN c.FORTYPCD = 987 THEN '980'\n   WHEN c.FORTYPCD = 988 THEN '980'\n   WHEN c.FORTYPCD = 989 THEN '980'\n   WHEN c.FORTYPCD = 990 THEN '990'\n   WHEN c.FORTYPCD = 991 THEN '990'\n   WHEN c.FORTYPCD = 992 THEN '990'\n   WHEN c.FORTYPCD = 993 THEN '990'\n   WHEN c.FORTYPCD = 995 THEN '990'\n   WHEN c.FORTYPCD = 999 THEN '999' END) AS FORTYPGRPCD, 1 AS TOTAL\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)"
#> 
#> $dbqueries$TREE
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3)\n-------------------------------------------\n SELECT t.PLT_CN, t.CONDID, t.SUBP, t.TREE, t.STATUSCD, t.SPCD, t.SPGRPCD, t.DIA, t.HT, t.TREECLCD, t.AGENTCD, t.STANDING_DEAD_CD, t.VOLCFNET, t.VOLCFGRS, t.VOLBFNET, t.TPA_UNADJ, t.DRYBIO_AG, t.CARBON_AG\n FROM pltids\n JOIN treex t ON (t.PLT_CN = pltids.CN)"
#> 
#> 
#> $dbqueriesWITH
#> $dbqueriesWITH$pltidsWITH
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3)"
#> 
#> $dbqueriesWITH$pltidsadjWITH
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3),\n----- calculate plot-level adjustment factors\nSELECT pltids.CN,\n   COALESCE(1 / NULLIF(SUM(CONDPROP_UNADJ),0), 0) AS ADJ_FACTOR_COND,\n   COALESCE(1 / NULLIF(SUM(SUBPPROP_UNADJ),0), 0) AS ADJ_FACTOR_SUBP,\n   COALESCE(1 / NULLIF(SUM(MACRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MACR,\n   COALESCE(1 / NULLIF(SUM(MICRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MICR\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)\n WHERE c.COND_STATUS_CD <> 5\n GROUP BY pltids.CN"
#> 
#> $dbqueriesWITH$pltcondxWITH
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3), \n----- pltcondx\npltcondx AS\n(SELECT c.PLT_CN, c.CONDID, c.COND_NONSAMPLE_REASN_CD, c.CONDPROP_UNADJ, c.SUBPPROP_UNADJ, c.MICRPROP_UNADJ, c.MACRPROP_UNADJ, c.OWNCD, c.OWNGRPCD, c.RESERVCD, c.SITECLCD, c.STDORGCD, c.ADFORCD, c.LIVE_CANOPY_CVR_PCT, c.COND_STATUS_CD, c.NF_COND_STATUS_CD, c.FORTYPCD, c.STDSZCD, c.STDAGE, c.GSSTKCD, c.DSTRBCD1, c.DSTRBYR1, c.DSTRBCD2, c.DSTRBYR2, \n   (CASE\n   WHEN c.FORTYPCD = 100 THEN '100'\n   WHEN c.FORTYPCD = 101 THEN '100'\n   WHEN c.FORTYPCD = 102 THEN '100'\n   WHEN c.FORTYPCD = 103 THEN '100'\n   WHEN c.FORTYPCD = 104 THEN '100'\n   WHEN c.FORTYPCD = 105 THEN '100'\n   WHEN c.FORTYPCD = 120 THEN '120'\n   WHEN c.FORTYPCD = 121 THEN '120'\n   WHEN c.FORTYPCD = 122 THEN '120'\n   WHEN c.FORTYPCD = 123 THEN '120'\n   WHEN c.FORTYPCD = 124 THEN '120'\n   WHEN c.FORTYPCD = 125 THEN '120'\n   WHEN c.FORTYPCD = 126 THEN '120'\n   WHEN c.FORTYPCD = 127 THEN '120'\n   WHEN c.FORTYPCD = 128 THEN '120'\n   WHEN c.FORTYPCD = 129 THEN '120'\n   WHEN c.FORTYPCD = 140 THEN '140'\n   WHEN c.FORTYPCD = 141 THEN '140'\n   WHEN c.FORTYPCD = 142 THEN '140'\n   WHEN c.FORTYPCD = 150 THEN '150'\n   WHEN c.FORTYPCD = 151 THEN '150'\n   WHEN c.FORTYPCD = 160 THEN '160'\n   WHEN c.FORTYPCD = 161 THEN '160'\n   WHEN c.FORTYPCD = 162 THEN '160'\n   WHEN c.FORTYPCD = 163 THEN '160'\n   WHEN c.FORTYPCD = 164 THEN '160'\n   WHEN c.FORTYPCD = 165 THEN '160'\n   WHEN c.FORTYPCD = 166 THEN '160'\n   WHEN c.FORTYPCD = 167 THEN '160'\n   WHEN c.FORTYPCD = 168 THEN '160'\n   WHEN c.FORTYPCD = 170 THEN '170'\n   WHEN c.FORTYPCD = 171 THEN '170'\n   WHEN c.FORTYPCD = 172 THEN '170'\n   WHEN c.FORTYPCD = 180 THEN '180'\n   WHEN c.FORTYPCD = 181 THEN '180'\n   WHEN c.FORTYPCD = 182 THEN '180'\n   WHEN c.FORTYPCD = 183 THEN '180'\n   WHEN c.FORTYPCD = 184 THEN '180'\n   WHEN c.FORTYPCD = 185 THEN '180'\n   WHEN c.FORTYPCD = 200 THEN '200'\n   WHEN c.FORTYPCD = 201 THEN '200'\n   WHEN c.FORTYPCD = 202 THEN '200'\n   WHEN c.FORTYPCD = 203 THEN '200'\n   WHEN c.FORTYPCD = 220 THEN '220'\n   WHEN c.FORTYPCD = 221 THEN '220'\n   WHEN c.FORTYPCD = 222 THEN '220'\n   WHEN c.FORTYPCD = 223 THEN '220'\n   WHEN c.FORTYPCD = 224 THEN '220'\n   WHEN c.FORTYPCD = 225 THEN '220'\n   WHEN c.FORTYPCD = 226 THEN '220'\n   WHEN c.FORTYPCD = 240 THEN '240'\n   WHEN c.FORTYPCD = 241 THEN '240'\n   WHEN c.FORTYPCD = 260 THEN '260'\n   WHEN c.FORTYPCD = 261 THEN '260'\n   WHEN c.FORTYPCD = 262 THEN '260'\n   WHEN c.FORTYPCD = 263 THEN '260'\n   WHEN c.FORTYPCD = 264 THEN '260'\n   WHEN c.FORTYPCD = 265 THEN '260'\n   WHEN c.FORTYPCD = 266 THEN '260'\n   WHEN c.FORTYPCD = 267 THEN '260'\n   WHEN c.FORTYPCD = 268 THEN '260'\n   WHEN c.FORTYPCD = 269 THEN '260'\n   WHEN c.FORTYPCD = 270 THEN '260'\n   WHEN c.FORTYPCD = 271 THEN '260'\n   WHEN c.FORTYPCD = 280 THEN '280'\n   WHEN c.FORTYPCD = 281 THEN '280'\n   WHEN c.FORTYPCD = 300 THEN '300'\n   WHEN c.FORTYPCD = 301 THEN '300'\n   WHEN c.FORTYPCD = 304 THEN '300'\n   WHEN c.FORTYPCD = 305 THEN '300'\n   WHEN c.FORTYPCD = 320 THEN '320'\n   WHEN c.FORTYPCD = 321 THEN '320'\n   WHEN c.FORTYPCD = 340 THEN '340'\n   WHEN c.FORTYPCD = 341 THEN '340'\n   WHEN c.FORTYPCD = 342 THEN '340'\n   WHEN c.FORTYPCD = 360 THEN '360'\n   WHEN c.FORTYPCD = 361 THEN '360'\n   WHEN c.FORTYPCD = 362 THEN '360'\n   WHEN c.FORTYPCD = 363 THEN '360'\n   WHEN c.FORTYPCD = 364 THEN '360'\n   WHEN c.FORTYPCD = 365 THEN '360'\n   WHEN c.FORTYPCD = 366 THEN '360'\n   WHEN c.FORTYPCD = 367 THEN '360'\n   WHEN c.FORTYPCD = 368 THEN '360'\n   WHEN c.FORTYPCD = 369 THEN '360'\n   WHEN c.FORTYPCD = 370 THEN '370'\n   WHEN c.FORTYPCD = 371 THEN '370'\n   WHEN c.FORTYPCD = 380 THEN '380'\n   WHEN c.FORTYPCD = 381 THEN '380'\n   WHEN c.FORTYPCD = 382 THEN '380'\n   WHEN c.FORTYPCD = 383 THEN '380'\n   WHEN c.FORTYPCD = 384 THEN '380'\n   WHEN c.FORTYPCD = 385 THEN '380'\n   WHEN c.FORTYPCD = 390 THEN '390'\n   WHEN c.FORTYPCD = 391 THEN '390'\n   WHEN c.FORTYPCD = 400 THEN '400'\n   WHEN c.FORTYPCD = 401 THEN '400'\n   WHEN c.FORTYPCD = 402 THEN '400'\n   WHEN c.FORTYPCD = 403 THEN '400'\n   WHEN c.FORTYPCD = 404 THEN '400'\n   WHEN c.FORTYPCD = 405 THEN '400'\n   WHEN c.FORTYPCD = 406 THEN '400'\n   WHEN c.FORTYPCD = 407 THEN '400'\n   WHEN c.FORTYPCD = 409 THEN '400'\n   WHEN c.FORTYPCD = 500 THEN '500'\n   WHEN c.FORTYPCD = 501 THEN '500'\n   WHEN c.FORTYPCD = 502 THEN '500'\n   WHEN c.FORTYPCD = 503 THEN '500'\n   WHEN c.FORTYPCD = 504 THEN '500'\n   WHEN c.FORTYPCD = 505 THEN '500'\n   WHEN c.FORTYPCD = 506 THEN '500'\n   WHEN c.FORTYPCD = 507 THEN '500'\n   WHEN c.FORTYPCD = 508 THEN '500'\n   WHEN c.FORTYPCD = 509 THEN '500'\n   WHEN c.FORTYPCD = 510 THEN '500'\n   WHEN c.FORTYPCD = 511 THEN '500'\n   WHEN c.FORTYPCD = 512 THEN '500'\n   WHEN c.FORTYPCD = 513 THEN '500'\n   WHEN c.FORTYPCD = 514 THEN '500'\n   WHEN c.FORTYPCD = 515 THEN '500'\n   WHEN c.FORTYPCD = 516 THEN '500'\n   WHEN c.FORTYPCD = 517 THEN '500'\n   WHEN c.FORTYPCD = 519 THEN '500'\n   WHEN c.FORTYPCD = 520 THEN '500'\n   WHEN c.FORTYPCD = 600 THEN '600'\n   WHEN c.FORTYPCD = 601 THEN '600'\n   WHEN c.FORTYPCD = 602 THEN '600'\n   WHEN c.FORTYPCD = 605 THEN '600'\n   WHEN c.FORTYPCD = 606 THEN '600'\n   WHEN c.FORTYPCD = 607 THEN '600'\n   WHEN c.FORTYPCD = 608 THEN '600'\n   WHEN c.FORTYPCD = 609 THEN '600'\n   WHEN c.FORTYPCD = 700 THEN '700'\n   WHEN c.FORTYPCD = 701 THEN '700'\n   WHEN c.FORTYPCD = 702 THEN '700'\n   WHEN c.FORTYPCD = 703 THEN '700'\n   WHEN c.FORTYPCD = 704 THEN '700'\n   WHEN c.FORTYPCD = 705 THEN '700'\n   WHEN c.FORTYPCD = 706 THEN '700'\n   WHEN c.FORTYPCD = 707 THEN '700'\n   WHEN c.FORTYPCD = 708 THEN '700'\n   WHEN c.FORTYPCD = 709 THEN '700'\n   WHEN c.FORTYPCD = 722 THEN '700'\n   WHEN c.FORTYPCD = 800 THEN '800'\n   WHEN c.FORTYPCD = 801 THEN '800'\n   WHEN c.FORTYPCD = 802 THEN '800'\n   WHEN c.FORTYPCD = 803 THEN '800'\n   WHEN c.FORTYPCD = 805 THEN '800'\n   WHEN c.FORTYPCD = 807 THEN '800'\n   WHEN c.FORTYPCD = 809 THEN '800'\n   WHEN c.FORTYPCD = 900 THEN '900'\n   WHEN c.FORTYPCD = 901 THEN '900'\n   WHEN c.FORTYPCD = 902 THEN '900'\n   WHEN c.FORTYPCD = 903 THEN '900'\n   WHEN c.FORTYPCD = 904 THEN '900'\n   WHEN c.FORTYPCD = 905 THEN '900'\n   WHEN c.FORTYPCD = 910 THEN '910'\n   WHEN c.FORTYPCD = 911 THEN '910'\n   WHEN c.FORTYPCD = 912 THEN '910'\n   WHEN c.FORTYPCD = 920 THEN '920'\n   WHEN c.FORTYPCD = 921 THEN '920'\n   WHEN c.FORTYPCD = 922 THEN '920'\n   WHEN c.FORTYPCD = 923 THEN '920'\n   WHEN c.FORTYPCD = 924 THEN '920'\n   WHEN c.FORTYPCD = 925 THEN '920'\n   WHEN c.FORTYPCD = 926 THEN '920'\n   WHEN c.FORTYPCD = 931 THEN '920'\n   WHEN c.FORTYPCD = 932 THEN '920'\n   WHEN c.FORTYPCD = 933 THEN '920'\n   WHEN c.FORTYPCD = 934 THEN '920'\n   WHEN c.FORTYPCD = 935 THEN '920'\n   WHEN c.FORTYPCD = 940 THEN '940'\n   WHEN c.FORTYPCD = 941 THEN '940'\n   WHEN c.FORTYPCD = 942 THEN '940'\n   WHEN c.FORTYPCD = 943 THEN '940'\n   WHEN c.FORTYPCD = 950 THEN '950'\n   WHEN c.FORTYPCD = 951 THEN '950'\n   WHEN c.FORTYPCD = 952 THEN '950'\n   WHEN c.FORTYPCD = 953 THEN '950'\n   WHEN c.FORTYPCD = 954 THEN '950'\n   WHEN c.FORTYPCD = 955 THEN '950'\n   WHEN c.FORTYPCD = 960 THEN '960'\n   WHEN c.FORTYPCD = 961 THEN '960'\n   WHEN c.FORTYPCD = 962 THEN '960'\n   WHEN c.FORTYPCD = 970 THEN '970'\n   WHEN c.FORTYPCD = 971 THEN '970'\n   WHEN c.FORTYPCD = 972 THEN '970'\n   WHEN c.FORTYPCD = 973 THEN '970'\n   WHEN c.FORTYPCD = 974 THEN '970'\n   WHEN c.FORTYPCD = 975 THEN '970'\n   WHEN c.FORTYPCD = 976 THEN '970'\n   WHEN c.FORTYPCD = 980 THEN '980'\n   WHEN c.FORTYPCD = 981 THEN '980'\n   WHEN c.FORTYPCD = 982 THEN '980'\n   WHEN c.FORTYPCD = 983 THEN '980'\n   WHEN c.FORTYPCD = 984 THEN '980'\n   WHEN c.FORTYPCD = 985 THEN '980'\n   WHEN c.FORTYPCD = 986 THEN '980'\n   WHEN c.FORTYPCD = 987 THEN '980'\n   WHEN c.FORTYPCD = 988 THEN '980'\n   WHEN c.FORTYPCD = 989 THEN '980'\n   WHEN c.FORTYPCD = 990 THEN '990'\n   WHEN c.FORTYPCD = 991 THEN '990'\n   WHEN c.FORTYPCD = 992 THEN '990'\n   WHEN c.FORTYPCD = 993 THEN '990'\n   WHEN c.FORTYPCD = 995 THEN '990'\n   WHEN c.FORTYPCD = 999 THEN '999' END) AS FORTYPGRPCD, 1 AS TOTAL\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN))"
#> 
#> $dbqueriesWITH$pltcondxadjWITH
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3),\n----- calculate plot-level adjustment factors\nSELECT pltids.CN,\n   COALESCE(1 / NULLIF(SUM(CONDPROP_UNADJ),0), 0) AS ADJ_FACTOR_COND,\n   COALESCE(1 / NULLIF(SUM(SUBPPROP_UNADJ),0), 0) AS ADJ_FACTOR_SUBP,\n   COALESCE(1 / NULLIF(SUM(MACRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MACR,\n   COALESCE(1 / NULLIF(SUM(MICRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MICR\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)\n WHERE c.COND_STATUS_CD <> 5\n GROUP BY pltids.CN, \n----- pltcondx\npltcondx AS\n(SELECT c.PLT_CN, c.CONDID, c.COND_NONSAMPLE_REASN_CD, c.CONDPROP_UNADJ, c.SUBPPROP_UNADJ, c.MICRPROP_UNADJ, c.MACRPROP_UNADJ, c.OWNCD, c.OWNGRPCD, c.RESERVCD, c.SITECLCD, c.STDORGCD, c.ADFORCD, c.LIVE_CANOPY_CVR_PCT, c.COND_STATUS_CD, c.NF_COND_STATUS_CD, c.FORTYPCD, c.STDSZCD, c.STDAGE, c.GSSTKCD, c.DSTRBCD1, c.DSTRBYR1, c.DSTRBCD2, c.DSTRBYR2, \n   (CASE\n   WHEN c.FORTYPCD = 100 THEN '100'\n   WHEN c.FORTYPCD = 101 THEN '100'\n   WHEN c.FORTYPCD = 102 THEN '100'\n   WHEN c.FORTYPCD = 103 THEN '100'\n   WHEN c.FORTYPCD = 104 THEN '100'\n   WHEN c.FORTYPCD = 105 THEN '100'\n   WHEN c.FORTYPCD = 120 THEN '120'\n   WHEN c.FORTYPCD = 121 THEN '120'\n   WHEN c.FORTYPCD = 122 THEN '120'\n   WHEN c.FORTYPCD = 123 THEN '120'\n   WHEN c.FORTYPCD = 124 THEN '120'\n   WHEN c.FORTYPCD = 125 THEN '120'\n   WHEN c.FORTYPCD = 126 THEN '120'\n   WHEN c.FORTYPCD = 127 THEN '120'\n   WHEN c.FORTYPCD = 128 THEN '120'\n   WHEN c.FORTYPCD = 129 THEN '120'\n   WHEN c.FORTYPCD = 140 THEN '140'\n   WHEN c.FORTYPCD = 141 THEN '140'\n   WHEN c.FORTYPCD = 142 THEN '140'\n   WHEN c.FORTYPCD = 150 THEN '150'\n   WHEN c.FORTYPCD = 151 THEN '150'\n   WHEN c.FORTYPCD = 160 THEN '160'\n   WHEN c.FORTYPCD = 161 THEN '160'\n   WHEN c.FORTYPCD = 162 THEN '160'\n   WHEN c.FORTYPCD = 163 THEN '160'\n   WHEN c.FORTYPCD = 164 THEN '160'\n   WHEN c.FORTYPCD = 165 THEN '160'\n   WHEN c.FORTYPCD = 166 THEN '160'\n   WHEN c.FORTYPCD = 167 THEN '160'\n   WHEN c.FORTYPCD = 168 THEN '160'\n   WHEN c.FORTYPCD = 170 THEN '170'\n   WHEN c.FORTYPCD = 171 THEN '170'\n   WHEN c.FORTYPCD = 172 THEN '170'\n   WHEN c.FORTYPCD = 180 THEN '180'\n   WHEN c.FORTYPCD = 181 THEN '180'\n   WHEN c.FORTYPCD = 182 THEN '180'\n   WHEN c.FORTYPCD = 183 THEN '180'\n   WHEN c.FORTYPCD = 184 THEN '180'\n   WHEN c.FORTYPCD = 185 THEN '180'\n   WHEN c.FORTYPCD = 200 THEN '200'\n   WHEN c.FORTYPCD = 201 THEN '200'\n   WHEN c.FORTYPCD = 202 THEN '200'\n   WHEN c.FORTYPCD = 203 THEN '200'\n   WHEN c.FORTYPCD = 220 THEN '220'\n   WHEN c.FORTYPCD = 221 THEN '220'\n   WHEN c.FORTYPCD = 222 THEN '220'\n   WHEN c.FORTYPCD = 223 THEN '220'\n   WHEN c.FORTYPCD = 224 THEN '220'\n   WHEN c.FORTYPCD = 225 THEN '220'\n   WHEN c.FORTYPCD = 226 THEN '220'\n   WHEN c.FORTYPCD = 240 THEN '240'\n   WHEN c.FORTYPCD = 241 THEN '240'\n   WHEN c.FORTYPCD = 260 THEN '260'\n   WHEN c.FORTYPCD = 261 THEN '260'\n   WHEN c.FORTYPCD = 262 THEN '260'\n   WHEN c.FORTYPCD = 263 THEN '260'\n   WHEN c.FORTYPCD = 264 THEN '260'\n   WHEN c.FORTYPCD = 265 THEN '260'\n   WHEN c.FORTYPCD = 266 THEN '260'\n   WHEN c.FORTYPCD = 267 THEN '260'\n   WHEN c.FORTYPCD = 268 THEN '260'\n   WHEN c.FORTYPCD = 269 THEN '260'\n   WHEN c.FORTYPCD = 270 THEN '260'\n   WHEN c.FORTYPCD = 271 THEN '260'\n   WHEN c.FORTYPCD = 280 THEN '280'\n   WHEN c.FORTYPCD = 281 THEN '280'\n   WHEN c.FORTYPCD = 300 THEN '300'\n   WHEN c.FORTYPCD = 301 THEN '300'\n   WHEN c.FORTYPCD = 304 THEN '300'\n   WHEN c.FORTYPCD = 305 THEN '300'\n   WHEN c.FORTYPCD = 320 THEN '320'\n   WHEN c.FORTYPCD = 321 THEN '320'\n   WHEN c.FORTYPCD = 340 THEN '340'\n   WHEN c.FORTYPCD = 341 THEN '340'\n   WHEN c.FORTYPCD = 342 THEN '340'\n   WHEN c.FORTYPCD = 360 THEN '360'\n   WHEN c.FORTYPCD = 361 THEN '360'\n   WHEN c.FORTYPCD = 362 THEN '360'\n   WHEN c.FORTYPCD = 363 THEN '360'\n   WHEN c.FORTYPCD = 364 THEN '360'\n   WHEN c.FORTYPCD = 365 THEN '360'\n   WHEN c.FORTYPCD = 366 THEN '360'\n   WHEN c.FORTYPCD = 367 THEN '360'\n   WHEN c.FORTYPCD = 368 THEN '360'\n   WHEN c.FORTYPCD = 369 THEN '360'\n   WHEN c.FORTYPCD = 370 THEN '370'\n   WHEN c.FORTYPCD = 371 THEN '370'\n   WHEN c.FORTYPCD = 380 THEN '380'\n   WHEN c.FORTYPCD = 381 THEN '380'\n   WHEN c.FORTYPCD = 382 THEN '380'\n   WHEN c.FORTYPCD = 383 THEN '380'\n   WHEN c.FORTYPCD = 384 THEN '380'\n   WHEN c.FORTYPCD = 385 THEN '380'\n   WHEN c.FORTYPCD = 390 THEN '390'\n   WHEN c.FORTYPCD = 391 THEN '390'\n   WHEN c.FORTYPCD = 400 THEN '400'\n   WHEN c.FORTYPCD = 401 THEN '400'\n   WHEN c.FORTYPCD = 402 THEN '400'\n   WHEN c.FORTYPCD = 403 THEN '400'\n   WHEN c.FORTYPCD = 404 THEN '400'\n   WHEN c.FORTYPCD = 405 THEN '400'\n   WHEN c.FORTYPCD = 406 THEN '400'\n   WHEN c.FORTYPCD = 407 THEN '400'\n   WHEN c.FORTYPCD = 409 THEN '400'\n   WHEN c.FORTYPCD = 500 THEN '500'\n   WHEN c.FORTYPCD = 501 THEN '500'\n   WHEN c.FORTYPCD = 502 THEN '500'\n   WHEN c.FORTYPCD = 503 THEN '500'\n   WHEN c.FORTYPCD = 504 THEN '500'\n   WHEN c.FORTYPCD = 505 THEN '500'\n   WHEN c.FORTYPCD = 506 THEN '500'\n   WHEN c.FORTYPCD = 507 THEN '500'\n   WHEN c.FORTYPCD = 508 THEN '500'\n   WHEN c.FORTYPCD = 509 THEN '500'\n   WHEN c.FORTYPCD = 510 THEN '500'\n   WHEN c.FORTYPCD = 511 THEN '500'\n   WHEN c.FORTYPCD = 512 THEN '500'\n   WHEN c.FORTYPCD = 513 THEN '500'\n   WHEN c.FORTYPCD = 514 THEN '500'\n   WHEN c.FORTYPCD = 515 THEN '500'\n   WHEN c.FORTYPCD = 516 THEN '500'\n   WHEN c.FORTYPCD = 517 THEN '500'\n   WHEN c.FORTYPCD = 519 THEN '500'\n   WHEN c.FORTYPCD = 520 THEN '500'\n   WHEN c.FORTYPCD = 600 THEN '600'\n   WHEN c.FORTYPCD = 601 THEN '600'\n   WHEN c.FORTYPCD = 602 THEN '600'\n   WHEN c.FORTYPCD = 605 THEN '600'\n   WHEN c.FORTYPCD = 606 THEN '600'\n   WHEN c.FORTYPCD = 607 THEN '600'\n   WHEN c.FORTYPCD = 608 THEN '600'\n   WHEN c.FORTYPCD = 609 THEN '600'\n   WHEN c.FORTYPCD = 700 THEN '700'\n   WHEN c.FORTYPCD = 701 THEN '700'\n   WHEN c.FORTYPCD = 702 THEN '700'\n   WHEN c.FORTYPCD = 703 THEN '700'\n   WHEN c.FORTYPCD = 704 THEN '700'\n   WHEN c.FORTYPCD = 705 THEN '700'\n   WHEN c.FORTYPCD = 706 THEN '700'\n   WHEN c.FORTYPCD = 707 THEN '700'\n   WHEN c.FORTYPCD = 708 THEN '700'\n   WHEN c.FORTYPCD = 709 THEN '700'\n   WHEN c.FORTYPCD = 722 THEN '700'\n   WHEN c.FORTYPCD = 800 THEN '800'\n   WHEN c.FORTYPCD = 801 THEN '800'\n   WHEN c.FORTYPCD = 802 THEN '800'\n   WHEN c.FORTYPCD = 803 THEN '800'\n   WHEN c.FORTYPCD = 805 THEN '800'\n   WHEN c.FORTYPCD = 807 THEN '800'\n   WHEN c.FORTYPCD = 809 THEN '800'\n   WHEN c.FORTYPCD = 900 THEN '900'\n   WHEN c.FORTYPCD = 901 THEN '900'\n   WHEN c.FORTYPCD = 902 THEN '900'\n   WHEN c.FORTYPCD = 903 THEN '900'\n   WHEN c.FORTYPCD = 904 THEN '900'\n   WHEN c.FORTYPCD = 905 THEN '900'\n   WHEN c.FORTYPCD = 910 THEN '910'\n   WHEN c.FORTYPCD = 911 THEN '910'\n   WHEN c.FORTYPCD = 912 THEN '910'\n   WHEN c.FORTYPCD = 920 THEN '920'\n   WHEN c.FORTYPCD = 921 THEN '920'\n   WHEN c.FORTYPCD = 922 THEN '920'\n   WHEN c.FORTYPCD = 923 THEN '920'\n   WHEN c.FORTYPCD = 924 THEN '920'\n   WHEN c.FORTYPCD = 925 THEN '920'\n   WHEN c.FORTYPCD = 926 THEN '920'\n   WHEN c.FORTYPCD = 931 THEN '920'\n   WHEN c.FORTYPCD = 932 THEN '920'\n   WHEN c.FORTYPCD = 933 THEN '920'\n   WHEN c.FORTYPCD = 934 THEN '920'\n   WHEN c.FORTYPCD = 935 THEN '920'\n   WHEN c.FORTYPCD = 940 THEN '940'\n   WHEN c.FORTYPCD = 941 THEN '940'\n   WHEN c.FORTYPCD = 942 THEN '940'\n   WHEN c.FORTYPCD = 943 THEN '940'\n   WHEN c.FORTYPCD = 950 THEN '950'\n   WHEN c.FORTYPCD = 951 THEN '950'\n   WHEN c.FORTYPCD = 952 THEN '950'\n   WHEN c.FORTYPCD = 953 THEN '950'\n   WHEN c.FORTYPCD = 954 THEN '950'\n   WHEN c.FORTYPCD = 955 THEN '950'\n   WHEN c.FORTYPCD = 960 THEN '960'\n   WHEN c.FORTYPCD = 961 THEN '960'\n   WHEN c.FORTYPCD = 962 THEN '960'\n   WHEN c.FORTYPCD = 970 THEN '970'\n   WHEN c.FORTYPCD = 971 THEN '970'\n   WHEN c.FORTYPCD = 972 THEN '970'\n   WHEN c.FORTYPCD = 973 THEN '970'\n   WHEN c.FORTYPCD = 974 THEN '970'\n   WHEN c.FORTYPCD = 975 THEN '970'\n   WHEN c.FORTYPCD = 976 THEN '970'\n   WHEN c.FORTYPCD = 980 THEN '980'\n   WHEN c.FORTYPCD = 981 THEN '980'\n   WHEN c.FORTYPCD = 982 THEN '980'\n   WHEN c.FORTYPCD = 983 THEN '980'\n   WHEN c.FORTYPCD = 984 THEN '980'\n   WHEN c.FORTYPCD = 985 THEN '980'\n   WHEN c.FORTYPCD = 986 THEN '980'\n   WHEN c.FORTYPCD = 987 THEN '980'\n   WHEN c.FORTYPCD = 988 THEN '980'\n   WHEN c.FORTYPCD = 989 THEN '980'\n   WHEN c.FORTYPCD = 990 THEN '990'\n   WHEN c.FORTYPCD = 991 THEN '990'\n   WHEN c.FORTYPCD = 992 THEN '990'\n   WHEN c.FORTYPCD = 993 THEN '990'\n   WHEN c.FORTYPCD = 995 THEN '990'\n   WHEN c.FORTYPCD = 999 THEN '999' END) AS FORTYPGRPCD, 1 AS TOTAL\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN))"
#> 
#> 
#> $pltassgnx
#> Key: <CN>
#>                   CN ESTN_UNIT        dem        tcc          tpi    tnt
#>               <char>    <fctr>      <num>      <num>        <num> <fctr>
#>    1: 40404728010690         1  0.8605029 -0.4883215  1.930461976      2
#>    2: 40404729010690         1  0.8807561 -0.1549622  0.158401977      2
#>    3: 40404730010690         1  0.6620211  2.5119114 -2.152005364      1
#>    4: 40404731010690         1  0.5182231 -0.4883215  0.001384002      2
#>    5: 40404733010690         1  0.6660718 -0.4883215  0.248126534      2
#>   ---                                                                   
#> 3043: 40407866010690        45 -1.4159615 -0.3549778  0.046246280      2
#> 3044: 40407867010690        45 -1.3389992 -0.4883215  0.539731344      2
#> 3045: 40407868010690        45 -1.3673537 -0.4883215  0.360282230      2
#> 3046: 40407869010690        45 -1.4949491 -0.4883215  0.248126534      2
#> 3047: 46792188020004        29  0.4412608  0.3784125  0.113539698      2
#>       PLOT_STATUS_CD       tnt2
#>                <int>      <num>
#>    1:              2  0.4328854
#>    2:              1  0.4328854
#>    3:              1 -2.3093221
#>    4:              2  0.4328854
#>    5:              2  0.4328854
#>   ---                          
#> 3043:              2  0.4328854
#> 3044:              2  0.4328854
#> 3045:              2  0.4328854
#> 3046:              2  0.4328854
#> 3047:              1  0.4328854
#> 
#> $unitlut
#>     ESTN_UNIT STATECD COUNTYCD        dem         tcc        tpi         tnt2
#>        <fctr>   <int>    <num>      <num>       <num>      <num>        <num>
#>  1:         1      56        1  0.6598451 -0.03141457 0.02410391 -0.042887844
#>  2:         3      56        3 -0.6063518  0.03853765 0.02375948  0.018075308
#>  3:         5      56        5 -1.1747311 -0.32445118 0.02392288  0.354126836
#>  4:         7      56        7  0.5592886  0.01329258 0.02386679 -0.013807115
#>  5:         9      56        9 -0.5938230 -0.25765696 0.02366908  0.198092337
#>  6:        11      56       11 -1.3094397  0.40230718 0.02371708 -0.313472854
#>  7:        13      56       13  0.3972305 -0.06168731 0.02355032 -0.008444611
#>  8:        15      56       15 -1.0811447 -0.39829389 0.02385520  0.380809162
#>  9:        17      56       17 -0.1489854 -0.21369211 0.02429740 -0.020315265
#> 10:        19      56       19 -0.5102112  0.14107300 0.02396383 -0.046262537
#> 11:        21      56       21 -0.2463118 -0.41499575 0.02376571  0.396036366
#> 12:        23      56       23  0.6245413  0.37904477 0.02373278 -0.299005826
#> 13:        25      56       25 -0.1923341 -0.35050535 0.02401586  0.301923399
#> 14:        27      56       27 -1.1468399 -0.42551939 0.02391425  0.304101296
#> 15:        29      56       29  0.6983394  0.61652010 0.02383676 -0.728038041
#> 16:        31      56       31 -0.7592113 -0.26690880 0.02369780  0.226691002
#> 17:        33      56       33 -0.7626303  0.49425044 0.02387319 -0.345621625
#> 18:        35      56       35  1.0107771  0.21888086 0.02454527 -0.222879790
#> 19:        37      56       37  0.2924267 -0.43402957 0.02382172  0.391209881
#> 20:        39      56       39  1.0255653  1.48278434 0.02372393 -1.312464307
#> 21:        41      56       41  0.5315508 -0.15177307 0.02359849  0.133340723
#> 22:        43      56       43 -0.7130302 -0.14297623 0.02342656  0.156749635
#> 23:        45      56       45 -1.1930271 -0.20750101 0.02353014  0.125040286
#>     ESTN_UNIT STATECD COUNTYCD        dem         tcc        tpi         tnt2
#>     n.total
#>       <int>
#>  1:     133
#>  2:      98
#>  3:     152
#>  4:     245
#>  5:     133
#>  6:      85
#>  7:     290
#>  8:      70
#>  9:      58
#> 10:     128
#> 11:      86
#> 12:     132
#> 13:     175
#> 14:      79
#> 15:     216
#> 16:      64
#> 17:      82
#> 18:     158
#> 19:     339
#> 20:     125
#> 21:      63
#> 22:      63
#> 23:      73
#>     n.total
#> 
#> $unitarea
#> Key: <ESTN_UNIT>
#>     ESTN_UNIT   ACRES
#>         <num>   <num>
#>  1:         1 2757613
#>  2:         3 2021729
#>  3:         5 3072988
#>  4:         7 5096959
#>  5:         9 2729653
#>  6:        11 1837124
#>  7:        13 5930088
#>  8:        15 1428579
#>  9:        17 1283969
#> 10:        19 2671802
#> 11:        21 1720074
#> 12:        23 2616954
#> 13:        25 3440445
#> 14:        27 1681849
#> 15:        29 4459826
#> 16:        31 1350969
#> 17:        33 1617318
#> 18:        35 3158807
#> 19:        37 6714319
#> 20:        39 2701941
#> 21:        41 1336034
#> 22:        43 1435352
#> 23:        45 1536038
#>     ESTN_UNIT   ACRES
#> 
#> $npixels
#>     ESTN_UNIT npixels
#>         <num>   <num>
#>  1:         1 1376714
#>  2:         3 1010229
#>  3:         5 1538394
#>  4:         7 2546066
#>  5:         9 1362852
#>  6:        11  915454
#>  7:        13 2961420
#>  8:        15  713352
#>  9:        17  641459
#> 10:        19 1334190
#> 11:        21  859967
#> 12:        23 1308662
#> 13:        25 1720554
#> 14:        27  841523
#> 15:        29 2228161
#> 16:        31  675011
#> 17:        33  807188
#> 18:        35 1577267
#> 19:        37 3355881
#> 20:        39 1349166
#> 21:        41  668120
#> 22:        43  717122
#> 23:        45  767376
#>     ESTN_UNIT npixels
#> 
#> $npixelvar
#> [1] "npixels"
#> 
#> $estvar.area
#> [1] "CONDPROP_ADJ"
#> 
#> $areavar
#> [1] "ACRES"
#> 
#> $areaunits
#> [1] "acres"
#> 
#> $unitvar
#> [1] "ESTN_UNIT"
#> 
#> $unitvars
#> [1] "ESTN_UNIT"
#> 
#> $plotsampcnt
#> data frame with 0 columns and 0 rows
#> 
#> $condsampcnt
#>    COND_STATUS_NM COND_STATUS_CD NBRCONDS
#> 1  Nonforest land              2     2590
#> 2     Forest land              1      590
#> 3 Noncensus water              3       10
#> 4      Nonsampled              5       14
#> 5    Census water              4       20
#> 
#> $states
#> [1] "Wyoming"
#> 
#> $invyrs
#> NULL
#> 
#> $adj
#> [1] "plot"
#> 
#> $P2POINTCNT
#> data frame with 0 columns and 0 rows
#> 
#> $plotunitcnt
#>    ESTN_UNIT NBRPLOTS
#> 1          1      133
#> 2          3       98
#> 3          5      152
#> 4          7      245
#> 5          9      133
#> 6         11       85
#> 7         13      290
#> 8         15       70
#> 9         17       58
#> 10        19      128
#> 11        21       86
#> 12        23      132
#> 13        25      175
#> 14        27       79
#> 15        29      216
#> 16        31       64
#> 17        33       82
#> 18        35      158
#> 19        37      339
#> 20        39      125
#> 21        41       63
#> 22        43       63
#> 23        45       73
#> 
#> $treex
#> Key: <PLT_CN, CONDID, SUBP, TREE>
#>                PLT_CN CONDID  SUBP  TREE STATUSCD  SPCD SPGRPCD   DIA    HT
#>                <char>  <num> <num> <num>    <num> <num>   <num> <num> <num>
#>     1: 40404729010690      1     1     1        2   113      24   7.7    18
#>     2: 40404729010690      1     1     2        1    66      23  10.8    14
#>     3: 40404729010690      1     1     3        2   113      24   5.2    23
#>     4: 40404729010690      1     1     4        1   113      24   5.2    18
#>     5: 40404729010690      1     3     1        1   113      24   8.8    21
#>    ---                                                                     
#> 18570: 46792188020004      1     4    13        1   202      10   7.0    26
#> 18571: 46792188020004      1     4    14        2   202      10  11.4    53
#> 18572: 46792188020004      1     4    15        2   202      10  10.6    46
#> 18573: 46792188020004      1     4    16        2   202      10   6.3    41
#> 18574: 46792188020004      1     4    17        1   202      10   1.9     8
#>        TREECLCD AGENTCD STANDING_DEAD_CD  VOLCFNET  VOLCFGRS VOLBFNET TPA_UNADJ
#>           <num>   <num>            <num>     <num>     <num>    <num>     <num>
#>     1:        3      10                1  1.001201  1.820365       NA  6.018046
#>     2:        3      NA               NA        NA        NA       NA  6.018046
#>     3:        3      10                1  0.466414  0.848025       NA  6.018046
#>     4:        2      NA               NA  0.630180  0.630180       NA  6.018046
#>     5:        3      NA               NA  2.491559  2.931246       NA  6.018046
#>    ---                                                                         
#> 18570:        2      NA               NA  2.181686  2.181686       NA  6.018046
#> 18571:        3      NA                1 12.909056 12.909056       NA  6.018046
#> 18572:        3      NA                1  9.630596  9.630596       NA  6.018046
#> 18573:        3      NA                1  2.806583  2.806583       NA  6.018046
#> 18574:        3      NA               NA        NA        NA       NA 74.965282
#>         DRYBIO_AG  CARBON_AG tadjfac
#>             <num>      <num>   <num>
#>     1:  68.327405  34.437012       1
#>     2: 128.287031  61.192914       1
#>     3:  40.245848  20.283907       1
#>     4:  40.612073  19.493795       1
#>     5: 144.251149  69.240551       1
#>    ---                              
#> 18570: 115.692997  59.697586       1
#> 18571: 375.856438 190.183357       1
#> 18572: 270.737020 136.992932       1
#> 18573:  97.948647  49.562015       1
#> 18574:   3.145158   1.622902       1
#> 
#> $tuniqueid
#> [1] "PLT_CN"
#> 
#> $adjtree
#> [1] FALSE
#> 
#> $adjfactors
#> Key: <CN>
#>                   CN ADJ_FACTOR_COND ADJ_FACTOR_SUBP ADJ_FACTOR_MACR
#>               <char>           <num>           <num>           <int>
#>    1: 40404728010690               1               1               0
#>    2: 40404729010690               1               1               0
#>    3: 40404730010690               1               1               0
#>    4: 40404731010690               1               1               0
#>    5: 40404733010690               1               1               0
#>   ---                                                               
#> 3043: 40407866010690               1               1               0
#> 3044: 40407867010690               1               1               0
#> 3045: 40407868010690               1               1               0
#> 3046: 40407869010690               1               1               0
#> 3047: 46792188020004               1               1               0
#>       ADJ_FACTOR_MICR
#>                 <num>
#>    1:               1
#>    2:               1
#>    3:               1
#>    4:               1
#>    5:               1
#>   ---                
#> 3043:               1
#> 3044:               1
#> 3045:               1
#> 3046:               1
#> 3047:               1
#> 
#> $adjvarlst
#>              COND              SUBP              MACR              MICR 
#> "ADJ_FACTOR_COND" "ADJ_FACTOR_SUBP" "ADJ_FACTOR_MACR" "ADJ_FACTOR_MICR" 
#> 
#> $prednames
#> [1] "dem"  "tcc"  "tpi"  "tnt2"
#> 
#> $predfac
#> [1] "tnt"
#> 
#> $popdatindb
#> [1] FALSE
#> 
         
# Adding seedling data as well
modMApop(popTabs = list(tree = FIESTA::WYtree,
                        cond = FIESTA::WYcond,
                        seed = FIESTA::WYseed),
         pltassgn = FIESTA::WYpltassgn,
         pltassgnid = "CN",
         unitarea = FIESTA::WYunitarea,
         unitvar = "ESTN_UNIT",
         unitzonal = FIESTA::WYunitzonal,
         prednames = c("dem", "tcc", "tpi", "tnt"),
         predfac = "tnt")
#> variables are missing from dataset: STATECD, UNITCD, COUNTYCD, PLOT, PLOT_STATUS_CD, PLOT_NONSAMPLE_REASN_CD, INTENSITY, SUBCYCLE, MACRO_BREAKPOINT_DIA
#> SURVEY table does not exist in database... assuming annual inventory plots
#> INVYR not in input data...  no invyrs returned...
#> SUBCYCLE not in data... assuming all SUBCYCLE <> 99
#> removing nonsampled forest plots...
#> returning data needed for estimation...
#> there are 14 nonsampled conditions
#> $module
#> [1] "MA"
#> 
#> $popType
#> [1] "VOL"
#> 
#> $pltidsadj
#> Key: <CN>
#>                   CN ADJ_FACTOR_COND ADJ_FACTOR_SUBP ADJ_FACTOR_MACR
#>               <char>           <num>           <num>           <int>
#>    1: 40404728010690               1               1               0
#>    2: 40404729010690               1               1               0
#>    3: 40404730010690               1               1               0
#>    4: 40404731010690               1               1               0
#>    5: 40404733010690               1               1               0
#>   ---                                                               
#> 3043: 40407866010690               1               1               0
#> 3044: 40407867010690               1               1               0
#> 3045: 40407868010690               1               1               0
#> 3046: 40407869010690               1               1               0
#> 3047: 46792188020004               1               1               0
#>       ADJ_FACTOR_MICR
#>                 <num>
#>    1:               1
#>    2:               1
#>    3:               1
#>    4:               1
#>    5:               1
#>   ---                
#> 3043:               1
#> 3044:               1
#> 3045:               1
#> 3046:               1
#> 3047:               1
#> 
#> $pltcondx
#> Key: <PLT_CN, CONDID>
#>               PLT_CN CONDID COND_NONSAMPLE_REASN_CD CONDPROP_UNADJ
#>               <char>  <int>                   <int>          <num>
#>    1: 40404728010690      1                      NA              1
#>    2: 40404729010690      1                      NA              1
#>    3: 40404730010690      1                      NA              1
#>    4: 40404731010690      1                      NA              1
#>    5: 40404733010690      1                      NA              1
#>   ---                                                             
#> 3220: 40407866010690      1                      NA              1
#> 3221: 40407867010690      1                      NA              1
#> 3222: 40407868010690      1                      NA              1
#> 3223: 40407869010690      1                      NA              1
#> 3224: 46792188020004      1                      NA              1
#>       SUBPPROP_UNADJ MICRPROP_UNADJ MACRPROP_UNADJ OWNCD OWNGRPCD RESERVCD
#>                <num>          <num>         <lgcl> <int>    <int>    <int>
#>    1:              1              1             NA    46       40        0
#>    2:              1              1             NA    46       40        0
#>    3:              1              1             NA    11       10        0
#>    4:              1              1             NA    22       20        0
#>    5:              1              1             NA    46       40        0
#>   ---                                                                     
#> 3220:              1              1             NA    46       40        0
#> 3221:              1              1             NA    46       40        0
#> 3222:              1              1             NA    12       10        0
#> 3223:              1              1             NA    46       40        0
#> 3224:              1              1             NA    11       10        1
#>       SITECLCD STDORGCD ADFORCD LIVE_CANOPY_CVR_PCT COND_STATUS_CD
#>          <int>    <int>   <int>               <int>          <int>
#>    1:       NA       NA      NA                   0              2
#>    2:        7        0      NA                  17              1
#>    3:        6        0     206                  41              1
#>    4:       NA       NA      NA                   0              2
#>    5:       NA       NA      NA                   0              2
#>   ---                                                             
#> 3220:       NA       NA      NA                   0              2
#> 3221:       NA       NA      NA                   0              2
#> 3222:       NA       NA     206                   1              2
#> 3223:       NA       NA      NA                   0              2
#> 3224:        6        0     214                  48              1
#>       NF_COND_STATUS_CD FORTYPCD STDSZCD STDAGE GSSTKCD DSTRBCD1 DSTRBYR1
#>                   <int>    <int>   <int>  <int>   <int>    <int>    <int>
#>    1:                NA       NA      NA     NA      NA       NA       NA
#>    2:                NA      366       1     46       5        0       NA
#>    3:                NA      201       1    220       3        0       NA
#>    4:                NA       NA      NA     NA      NA       NA       NA
#>    5:                NA       NA      NA     NA      NA       NA       NA
#>   ---                                                                    
#> 3220:                NA       NA      NA     NA      NA       NA       NA
#> 3221:                NA       NA      NA     NA      NA       NA       NA
#> 3222:                NA       NA      NA     NA      NA       NA       NA
#> 3223:                NA       NA      NA     NA      NA       NA       NA
#> 3224:                NA      201       1    109       3        0       NA
#>       DSTRBCD2 DSTRBYR2 FORTYPGRPCD TOTAL LANDSTATUSCD
#>          <int>    <int>       <num> <int>        <num>
#>    1:       NA       NA          NA     1           NA
#>    2:        0       NA         360     1            2
#>    3:        0       NA         200     1            1
#>    4:       NA       NA          NA     1           NA
#>    5:       NA       NA          NA     1           NA
#>   ---                                                 
#> 3220:       NA       NA          NA     1           NA
#> 3221:       NA       NA          NA     1           NA
#> 3222:       NA       NA          NA     1           NA
#> 3223:       NA       NA          NA     1           NA
#> 3224:        0       NA         200     1            3
#>                         LANDSTATUSNM DSTRBGRP
#>                               <char>   <char>
#>    1:                           <NA>     <NA>
#>    2:               Other forestland        0
#>    3:                     Timberland        0
#>    4:                           <NA>     <NA>
#>    5:                           <NA>     <NA>
#>   ---                                        
#> 3220:                           <NA>     <NA>
#> 3221:                           <NA>     <NA>
#> 3222:                           <NA>     <NA>
#> 3223:                           <NA>     <NA>
#> 3224: Reserved productive forestland        0
#> 
#> $pltcondflds
#>  [1] "PLT_CN"                  "CONDID"                 
#>  [3] "COND_NONSAMPLE_REASN_CD" "CONDPROP_UNADJ"         
#>  [5] "SUBPPROP_UNADJ"          "MICRPROP_UNADJ"         
#>  [7] "MACRPROP_UNADJ"          "OWNCD"                  
#>  [9] "OWNGRPCD"                "RESERVCD"               
#> [11] "SITECLCD"                "STDORGCD"               
#> [13] "ADFORCD"                 "LIVE_CANOPY_CVR_PCT"    
#> [15] "COND_STATUS_CD"          "NF_COND_STATUS_CD"      
#> [17] "FORTYPCD"                "STDSZCD"                
#> [19] "STDAGE"                  "GSSTKCD"                
#> [21] "DSTRBCD1"                "DSTRBYR1"               
#> [23] "DSTRBCD2"                "DSTRBYR2"               
#> [25] "FORTYPGRPCD"             "LANDSTATUSCD"           
#> [27] "LANDSTATUSNM"            "DSTRBGRP"               
#> 
#> $pjoinid
#> [1] "CN"
#> 
#> $cuniqueid
#> [1] "PLT_CN"
#> 
#> $pltassgnid
#> [1] "CN"
#> 
#> $condid
#> [1] "CONDID"
#> 
#> $ACI
#> [1] FALSE
#> 
#> $areawt
#> [1] "CONDPROP_UNADJ"
#> 
#> $areawt2
#> NULL
#> 
#> $adjcase
#>              COND 
#> "ADJ_FACTOR_COND" 
#> 
#> $dbqueries
#> $dbqueries$adjfactors
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3)\n-------------------------------------------\nSELECT pltids.CN,\n   COALESCE(1 / NULLIF(SUM(CONDPROP_UNADJ),0), 0) AS ADJ_FACTOR_COND,\n   COALESCE(1 / NULLIF(SUM(SUBPPROP_UNADJ),0), 0) AS ADJ_FACTOR_SUBP,\n   COALESCE(1 / NULLIF(SUM(MACRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MACR,\n   COALESCE(1 / NULLIF(SUM(MICRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MICR\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)\n WHERE c.COND_STATUS_CD <> 5\n GROUP BY pltids.CN"
#> 
#> $dbqueries$pltidsadj
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3)\nSELECT pltids.CN,\n   COALESCE(1 / NULLIF(SUM(CONDPROP_UNADJ),0), 0) AS ADJ_FACTOR_COND,\n   COALESCE(1 / NULLIF(SUM(SUBPPROP_UNADJ),0), 0) AS ADJ_FACTOR_SUBP,\n   COALESCE(1 / NULLIF(SUM(MACRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MACR,\n   COALESCE(1 / NULLIF(SUM(MICRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MICR\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)\n WHERE c.COND_STATUS_CD <> 5\n GROUP BY pltids.CN"
#> 
#> $dbqueries$pltcondx
#> [1] "SELECT c.PLT_CN, c.CONDID, c.COND_NONSAMPLE_REASN_CD, c.CONDPROP_UNADJ, c.SUBPPROP_UNADJ, c.MICRPROP_UNADJ, c.MACRPROP_UNADJ, c.OWNCD, c.OWNGRPCD, c.RESERVCD, c.SITECLCD, c.STDORGCD, c.ADFORCD, c.LIVE_CANOPY_CVR_PCT, c.COND_STATUS_CD, c.NF_COND_STATUS_CD, c.FORTYPCD, c.STDSZCD, c.STDAGE, c.GSSTKCD, c.DSTRBCD1, c.DSTRBYR1, c.DSTRBCD2, c.DSTRBYR2, \n   (CASE\n   WHEN c.FORTYPCD = 100 THEN '100'\n   WHEN c.FORTYPCD = 101 THEN '100'\n   WHEN c.FORTYPCD = 102 THEN '100'\n   WHEN c.FORTYPCD = 103 THEN '100'\n   WHEN c.FORTYPCD = 104 THEN '100'\n   WHEN c.FORTYPCD = 105 THEN '100'\n   WHEN c.FORTYPCD = 120 THEN '120'\n   WHEN c.FORTYPCD = 121 THEN '120'\n   WHEN c.FORTYPCD = 122 THEN '120'\n   WHEN c.FORTYPCD = 123 THEN '120'\n   WHEN c.FORTYPCD = 124 THEN '120'\n   WHEN c.FORTYPCD = 125 THEN '120'\n   WHEN c.FORTYPCD = 126 THEN '120'\n   WHEN c.FORTYPCD = 127 THEN '120'\n   WHEN c.FORTYPCD = 128 THEN '120'\n   WHEN c.FORTYPCD = 129 THEN '120'\n   WHEN c.FORTYPCD = 140 THEN '140'\n   WHEN c.FORTYPCD = 141 THEN '140'\n   WHEN c.FORTYPCD = 142 THEN '140'\n   WHEN c.FORTYPCD = 150 THEN '150'\n   WHEN c.FORTYPCD = 151 THEN '150'\n   WHEN c.FORTYPCD = 160 THEN '160'\n   WHEN c.FORTYPCD = 161 THEN '160'\n   WHEN c.FORTYPCD = 162 THEN '160'\n   WHEN c.FORTYPCD = 163 THEN '160'\n   WHEN c.FORTYPCD = 164 THEN '160'\n   WHEN c.FORTYPCD = 165 THEN '160'\n   WHEN c.FORTYPCD = 166 THEN '160'\n   WHEN c.FORTYPCD = 167 THEN '160'\n   WHEN c.FORTYPCD = 168 THEN '160'\n   WHEN c.FORTYPCD = 170 THEN '170'\n   WHEN c.FORTYPCD = 171 THEN '170'\n   WHEN c.FORTYPCD = 172 THEN '170'\n   WHEN c.FORTYPCD = 180 THEN '180'\n   WHEN c.FORTYPCD = 181 THEN '180'\n   WHEN c.FORTYPCD = 182 THEN '180'\n   WHEN c.FORTYPCD = 183 THEN '180'\n   WHEN c.FORTYPCD = 184 THEN '180'\n   WHEN c.FORTYPCD = 185 THEN '180'\n   WHEN c.FORTYPCD = 200 THEN '200'\n   WHEN c.FORTYPCD = 201 THEN '200'\n   WHEN c.FORTYPCD = 202 THEN '200'\n   WHEN c.FORTYPCD = 203 THEN '200'\n   WHEN c.FORTYPCD = 220 THEN '220'\n   WHEN c.FORTYPCD = 221 THEN '220'\n   WHEN c.FORTYPCD = 222 THEN '220'\n   WHEN c.FORTYPCD = 223 THEN '220'\n   WHEN c.FORTYPCD = 224 THEN '220'\n   WHEN c.FORTYPCD = 225 THEN '220'\n   WHEN c.FORTYPCD = 226 THEN '220'\n   WHEN c.FORTYPCD = 240 THEN '240'\n   WHEN c.FORTYPCD = 241 THEN '240'\n   WHEN c.FORTYPCD = 260 THEN '260'\n   WHEN c.FORTYPCD = 261 THEN '260'\n   WHEN c.FORTYPCD = 262 THEN '260'\n   WHEN c.FORTYPCD = 263 THEN '260'\n   WHEN c.FORTYPCD = 264 THEN '260'\n   WHEN c.FORTYPCD = 265 THEN '260'\n   WHEN c.FORTYPCD = 266 THEN '260'\n   WHEN c.FORTYPCD = 267 THEN '260'\n   WHEN c.FORTYPCD = 268 THEN '260'\n   WHEN c.FORTYPCD = 269 THEN '260'\n   WHEN c.FORTYPCD = 270 THEN '260'\n   WHEN c.FORTYPCD = 271 THEN '260'\n   WHEN c.FORTYPCD = 280 THEN '280'\n   WHEN c.FORTYPCD = 281 THEN '280'\n   WHEN c.FORTYPCD = 300 THEN '300'\n   WHEN c.FORTYPCD = 301 THEN '300'\n   WHEN c.FORTYPCD = 304 THEN '300'\n   WHEN c.FORTYPCD = 305 THEN '300'\n   WHEN c.FORTYPCD = 320 THEN '320'\n   WHEN c.FORTYPCD = 321 THEN '320'\n   WHEN c.FORTYPCD = 340 THEN '340'\n   WHEN c.FORTYPCD = 341 THEN '340'\n   WHEN c.FORTYPCD = 342 THEN '340'\n   WHEN c.FORTYPCD = 360 THEN '360'\n   WHEN c.FORTYPCD = 361 THEN '360'\n   WHEN c.FORTYPCD = 362 THEN '360'\n   WHEN c.FORTYPCD = 363 THEN '360'\n   WHEN c.FORTYPCD = 364 THEN '360'\n   WHEN c.FORTYPCD = 365 THEN '360'\n   WHEN c.FORTYPCD = 366 THEN '360'\n   WHEN c.FORTYPCD = 367 THEN '360'\n   WHEN c.FORTYPCD = 368 THEN '360'\n   WHEN c.FORTYPCD = 369 THEN '360'\n   WHEN c.FORTYPCD = 370 THEN '370'\n   WHEN c.FORTYPCD = 371 THEN '370'\n   WHEN c.FORTYPCD = 380 THEN '380'\n   WHEN c.FORTYPCD = 381 THEN '380'\n   WHEN c.FORTYPCD = 382 THEN '380'\n   WHEN c.FORTYPCD = 383 THEN '380'\n   WHEN c.FORTYPCD = 384 THEN '380'\n   WHEN c.FORTYPCD = 385 THEN '380'\n   WHEN c.FORTYPCD = 390 THEN '390'\n   WHEN c.FORTYPCD = 391 THEN '390'\n   WHEN c.FORTYPCD = 400 THEN '400'\n   WHEN c.FORTYPCD = 401 THEN '400'\n   WHEN c.FORTYPCD = 402 THEN '400'\n   WHEN c.FORTYPCD = 403 THEN '400'\n   WHEN c.FORTYPCD = 404 THEN '400'\n   WHEN c.FORTYPCD = 405 THEN '400'\n   WHEN c.FORTYPCD = 406 THEN '400'\n   WHEN c.FORTYPCD = 407 THEN '400'\n   WHEN c.FORTYPCD = 409 THEN '400'\n   WHEN c.FORTYPCD = 500 THEN '500'\n   WHEN c.FORTYPCD = 501 THEN '500'\n   WHEN c.FORTYPCD = 502 THEN '500'\n   WHEN c.FORTYPCD = 503 THEN '500'\n   WHEN c.FORTYPCD = 504 THEN '500'\n   WHEN c.FORTYPCD = 505 THEN '500'\n   WHEN c.FORTYPCD = 506 THEN '500'\n   WHEN c.FORTYPCD = 507 THEN '500'\n   WHEN c.FORTYPCD = 508 THEN '500'\n   WHEN c.FORTYPCD = 509 THEN '500'\n   WHEN c.FORTYPCD = 510 THEN '500'\n   WHEN c.FORTYPCD = 511 THEN '500'\n   WHEN c.FORTYPCD = 512 THEN '500'\n   WHEN c.FORTYPCD = 513 THEN '500'\n   WHEN c.FORTYPCD = 514 THEN '500'\n   WHEN c.FORTYPCD = 515 THEN '500'\n   WHEN c.FORTYPCD = 516 THEN '500'\n   WHEN c.FORTYPCD = 517 THEN '500'\n   WHEN c.FORTYPCD = 519 THEN '500'\n   WHEN c.FORTYPCD = 520 THEN '500'\n   WHEN c.FORTYPCD = 600 THEN '600'\n   WHEN c.FORTYPCD = 601 THEN '600'\n   WHEN c.FORTYPCD = 602 THEN '600'\n   WHEN c.FORTYPCD = 605 THEN '600'\n   WHEN c.FORTYPCD = 606 THEN '600'\n   WHEN c.FORTYPCD = 607 THEN '600'\n   WHEN c.FORTYPCD = 608 THEN '600'\n   WHEN c.FORTYPCD = 609 THEN '600'\n   WHEN c.FORTYPCD = 700 THEN '700'\n   WHEN c.FORTYPCD = 701 THEN '700'\n   WHEN c.FORTYPCD = 702 THEN '700'\n   WHEN c.FORTYPCD = 703 THEN '700'\n   WHEN c.FORTYPCD = 704 THEN '700'\n   WHEN c.FORTYPCD = 705 THEN '700'\n   WHEN c.FORTYPCD = 706 THEN '700'\n   WHEN c.FORTYPCD = 707 THEN '700'\n   WHEN c.FORTYPCD = 708 THEN '700'\n   WHEN c.FORTYPCD = 709 THEN '700'\n   WHEN c.FORTYPCD = 722 THEN '700'\n   WHEN c.FORTYPCD = 800 THEN '800'\n   WHEN c.FORTYPCD = 801 THEN '800'\n   WHEN c.FORTYPCD = 802 THEN '800'\n   WHEN c.FORTYPCD = 803 THEN '800'\n   WHEN c.FORTYPCD = 805 THEN '800'\n   WHEN c.FORTYPCD = 807 THEN '800'\n   WHEN c.FORTYPCD = 809 THEN '800'\n   WHEN c.FORTYPCD = 900 THEN '900'\n   WHEN c.FORTYPCD = 901 THEN '900'\n   WHEN c.FORTYPCD = 902 THEN '900'\n   WHEN c.FORTYPCD = 903 THEN '900'\n   WHEN c.FORTYPCD = 904 THEN '900'\n   WHEN c.FORTYPCD = 905 THEN '900'\n   WHEN c.FORTYPCD = 910 THEN '910'\n   WHEN c.FORTYPCD = 911 THEN '910'\n   WHEN c.FORTYPCD = 912 THEN '910'\n   WHEN c.FORTYPCD = 920 THEN '920'\n   WHEN c.FORTYPCD = 921 THEN '920'\n   WHEN c.FORTYPCD = 922 THEN '920'\n   WHEN c.FORTYPCD = 923 THEN '920'\n   WHEN c.FORTYPCD = 924 THEN '920'\n   WHEN c.FORTYPCD = 925 THEN '920'\n   WHEN c.FORTYPCD = 926 THEN '920'\n   WHEN c.FORTYPCD = 931 THEN '920'\n   WHEN c.FORTYPCD = 932 THEN '920'\n   WHEN c.FORTYPCD = 933 THEN '920'\n   WHEN c.FORTYPCD = 934 THEN '920'\n   WHEN c.FORTYPCD = 935 THEN '920'\n   WHEN c.FORTYPCD = 940 THEN '940'\n   WHEN c.FORTYPCD = 941 THEN '940'\n   WHEN c.FORTYPCD = 942 THEN '940'\n   WHEN c.FORTYPCD = 943 THEN '940'\n   WHEN c.FORTYPCD = 950 THEN '950'\n   WHEN c.FORTYPCD = 951 THEN '950'\n   WHEN c.FORTYPCD = 952 THEN '950'\n   WHEN c.FORTYPCD = 953 THEN '950'\n   WHEN c.FORTYPCD = 954 THEN '950'\n   WHEN c.FORTYPCD = 955 THEN '950'\n   WHEN c.FORTYPCD = 960 THEN '960'\n   WHEN c.FORTYPCD = 961 THEN '960'\n   WHEN c.FORTYPCD = 962 THEN '960'\n   WHEN c.FORTYPCD = 970 THEN '970'\n   WHEN c.FORTYPCD = 971 THEN '970'\n   WHEN c.FORTYPCD = 972 THEN '970'\n   WHEN c.FORTYPCD = 973 THEN '970'\n   WHEN c.FORTYPCD = 974 THEN '970'\n   WHEN c.FORTYPCD = 975 THEN '970'\n   WHEN c.FORTYPCD = 976 THEN '970'\n   WHEN c.FORTYPCD = 980 THEN '980'\n   WHEN c.FORTYPCD = 981 THEN '980'\n   WHEN c.FORTYPCD = 982 THEN '980'\n   WHEN c.FORTYPCD = 983 THEN '980'\n   WHEN c.FORTYPCD = 984 THEN '980'\n   WHEN c.FORTYPCD = 985 THEN '980'\n   WHEN c.FORTYPCD = 986 THEN '980'\n   WHEN c.FORTYPCD = 987 THEN '980'\n   WHEN c.FORTYPCD = 988 THEN '980'\n   WHEN c.FORTYPCD = 989 THEN '980'\n   WHEN c.FORTYPCD = 990 THEN '990'\n   WHEN c.FORTYPCD = 991 THEN '990'\n   WHEN c.FORTYPCD = 992 THEN '990'\n   WHEN c.FORTYPCD = 993 THEN '990'\n   WHEN c.FORTYPCD = 995 THEN '990'\n   WHEN c.FORTYPCD = 999 THEN '999' END) AS FORTYPGRPCD, 1 AS TOTAL\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)"
#> 
#> $dbqueries$TREE
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3)\n-------------------------------------------\n SELECT t.PLT_CN, t.CONDID, t.SUBP, t.TREE, t.STATUSCD, t.SPCD, t.SPGRPCD, t.DIA, t.HT, t.TREECLCD, t.AGENTCD, t.STANDING_DEAD_CD, t.VOLCFNET, t.VOLCFGRS, t.VOLBFNET, t.TPA_UNADJ, t.DRYBIO_AG, t.CARBON_AG\n FROM pltids\n JOIN treex t ON (t.PLT_CN = pltids.CN)"
#> 
#> $dbqueries$SEEDLING
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3)\n-------------------------------------------\n SELECT s.PLT_CN, s.SUBP, s.CONDID, s.SPCD, s.SPGRPCD, s.TPA_UNADJ, s.TREECOUNT, s.TREECOUNT_CALC\n FROM pltids\n JOIN seedx s ON (s.PLT_CN = pltids.CN)"
#> 
#> 
#> $dbqueriesWITH
#> $dbqueriesWITH$pltidsWITH
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3)"
#> 
#> $dbqueriesWITH$pltidsadjWITH
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3),\n----- calculate plot-level adjustment factors\nSELECT pltids.CN,\n   COALESCE(1 / NULLIF(SUM(CONDPROP_UNADJ),0), 0) AS ADJ_FACTOR_COND,\n   COALESCE(1 / NULLIF(SUM(SUBPPROP_UNADJ),0), 0) AS ADJ_FACTOR_SUBP,\n   COALESCE(1 / NULLIF(SUM(MACRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MACR,\n   COALESCE(1 / NULLIF(SUM(MICRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MICR\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)\n WHERE c.COND_STATUS_CD <> 5\n GROUP BY pltids.CN"
#> 
#> $dbqueriesWITH$pltcondxWITH
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3), \n----- pltcondx\npltcondx AS\n(SELECT c.PLT_CN, c.CONDID, c.COND_NONSAMPLE_REASN_CD, c.CONDPROP_UNADJ, c.SUBPPROP_UNADJ, c.MICRPROP_UNADJ, c.MACRPROP_UNADJ, c.OWNCD, c.OWNGRPCD, c.RESERVCD, c.SITECLCD, c.STDORGCD, c.ADFORCD, c.LIVE_CANOPY_CVR_PCT, c.COND_STATUS_CD, c.NF_COND_STATUS_CD, c.FORTYPCD, c.STDSZCD, c.STDAGE, c.GSSTKCD, c.DSTRBCD1, c.DSTRBYR1, c.DSTRBCD2, c.DSTRBYR2, \n   (CASE\n   WHEN c.FORTYPCD = 100 THEN '100'\n   WHEN c.FORTYPCD = 101 THEN '100'\n   WHEN c.FORTYPCD = 102 THEN '100'\n   WHEN c.FORTYPCD = 103 THEN '100'\n   WHEN c.FORTYPCD = 104 THEN '100'\n   WHEN c.FORTYPCD = 105 THEN '100'\n   WHEN c.FORTYPCD = 120 THEN '120'\n   WHEN c.FORTYPCD = 121 THEN '120'\n   WHEN c.FORTYPCD = 122 THEN '120'\n   WHEN c.FORTYPCD = 123 THEN '120'\n   WHEN c.FORTYPCD = 124 THEN '120'\n   WHEN c.FORTYPCD = 125 THEN '120'\n   WHEN c.FORTYPCD = 126 THEN '120'\n   WHEN c.FORTYPCD = 127 THEN '120'\n   WHEN c.FORTYPCD = 128 THEN '120'\n   WHEN c.FORTYPCD = 129 THEN '120'\n   WHEN c.FORTYPCD = 140 THEN '140'\n   WHEN c.FORTYPCD = 141 THEN '140'\n   WHEN c.FORTYPCD = 142 THEN '140'\n   WHEN c.FORTYPCD = 150 THEN '150'\n   WHEN c.FORTYPCD = 151 THEN '150'\n   WHEN c.FORTYPCD = 160 THEN '160'\n   WHEN c.FORTYPCD = 161 THEN '160'\n   WHEN c.FORTYPCD = 162 THEN '160'\n   WHEN c.FORTYPCD = 163 THEN '160'\n   WHEN c.FORTYPCD = 164 THEN '160'\n   WHEN c.FORTYPCD = 165 THEN '160'\n   WHEN c.FORTYPCD = 166 THEN '160'\n   WHEN c.FORTYPCD = 167 THEN '160'\n   WHEN c.FORTYPCD = 168 THEN '160'\n   WHEN c.FORTYPCD = 170 THEN '170'\n   WHEN c.FORTYPCD = 171 THEN '170'\n   WHEN c.FORTYPCD = 172 THEN '170'\n   WHEN c.FORTYPCD = 180 THEN '180'\n   WHEN c.FORTYPCD = 181 THEN '180'\n   WHEN c.FORTYPCD = 182 THEN '180'\n   WHEN c.FORTYPCD = 183 THEN '180'\n   WHEN c.FORTYPCD = 184 THEN '180'\n   WHEN c.FORTYPCD = 185 THEN '180'\n   WHEN c.FORTYPCD = 200 THEN '200'\n   WHEN c.FORTYPCD = 201 THEN '200'\n   WHEN c.FORTYPCD = 202 THEN '200'\n   WHEN c.FORTYPCD = 203 THEN '200'\n   WHEN c.FORTYPCD = 220 THEN '220'\n   WHEN c.FORTYPCD = 221 THEN '220'\n   WHEN c.FORTYPCD = 222 THEN '220'\n   WHEN c.FORTYPCD = 223 THEN '220'\n   WHEN c.FORTYPCD = 224 THEN '220'\n   WHEN c.FORTYPCD = 225 THEN '220'\n   WHEN c.FORTYPCD = 226 THEN '220'\n   WHEN c.FORTYPCD = 240 THEN '240'\n   WHEN c.FORTYPCD = 241 THEN '240'\n   WHEN c.FORTYPCD = 260 THEN '260'\n   WHEN c.FORTYPCD = 261 THEN '260'\n   WHEN c.FORTYPCD = 262 THEN '260'\n   WHEN c.FORTYPCD = 263 THEN '260'\n   WHEN c.FORTYPCD = 264 THEN '260'\n   WHEN c.FORTYPCD = 265 THEN '260'\n   WHEN c.FORTYPCD = 266 THEN '260'\n   WHEN c.FORTYPCD = 267 THEN '260'\n   WHEN c.FORTYPCD = 268 THEN '260'\n   WHEN c.FORTYPCD = 269 THEN '260'\n   WHEN c.FORTYPCD = 270 THEN '260'\n   WHEN c.FORTYPCD = 271 THEN '260'\n   WHEN c.FORTYPCD = 280 THEN '280'\n   WHEN c.FORTYPCD = 281 THEN '280'\n   WHEN c.FORTYPCD = 300 THEN '300'\n   WHEN c.FORTYPCD = 301 THEN '300'\n   WHEN c.FORTYPCD = 304 THEN '300'\n   WHEN c.FORTYPCD = 305 THEN '300'\n   WHEN c.FORTYPCD = 320 THEN '320'\n   WHEN c.FORTYPCD = 321 THEN '320'\n   WHEN c.FORTYPCD = 340 THEN '340'\n   WHEN c.FORTYPCD = 341 THEN '340'\n   WHEN c.FORTYPCD = 342 THEN '340'\n   WHEN c.FORTYPCD = 360 THEN '360'\n   WHEN c.FORTYPCD = 361 THEN '360'\n   WHEN c.FORTYPCD = 362 THEN '360'\n   WHEN c.FORTYPCD = 363 THEN '360'\n   WHEN c.FORTYPCD = 364 THEN '360'\n   WHEN c.FORTYPCD = 365 THEN '360'\n   WHEN c.FORTYPCD = 366 THEN '360'\n   WHEN c.FORTYPCD = 367 THEN '360'\n   WHEN c.FORTYPCD = 368 THEN '360'\n   WHEN c.FORTYPCD = 369 THEN '360'\n   WHEN c.FORTYPCD = 370 THEN '370'\n   WHEN c.FORTYPCD = 371 THEN '370'\n   WHEN c.FORTYPCD = 380 THEN '380'\n   WHEN c.FORTYPCD = 381 THEN '380'\n   WHEN c.FORTYPCD = 382 THEN '380'\n   WHEN c.FORTYPCD = 383 THEN '380'\n   WHEN c.FORTYPCD = 384 THEN '380'\n   WHEN c.FORTYPCD = 385 THEN '380'\n   WHEN c.FORTYPCD = 390 THEN '390'\n   WHEN c.FORTYPCD = 391 THEN '390'\n   WHEN c.FORTYPCD = 400 THEN '400'\n   WHEN c.FORTYPCD = 401 THEN '400'\n   WHEN c.FORTYPCD = 402 THEN '400'\n   WHEN c.FORTYPCD = 403 THEN '400'\n   WHEN c.FORTYPCD = 404 THEN '400'\n   WHEN c.FORTYPCD = 405 THEN '400'\n   WHEN c.FORTYPCD = 406 THEN '400'\n   WHEN c.FORTYPCD = 407 THEN '400'\n   WHEN c.FORTYPCD = 409 THEN '400'\n   WHEN c.FORTYPCD = 500 THEN '500'\n   WHEN c.FORTYPCD = 501 THEN '500'\n   WHEN c.FORTYPCD = 502 THEN '500'\n   WHEN c.FORTYPCD = 503 THEN '500'\n   WHEN c.FORTYPCD = 504 THEN '500'\n   WHEN c.FORTYPCD = 505 THEN '500'\n   WHEN c.FORTYPCD = 506 THEN '500'\n   WHEN c.FORTYPCD = 507 THEN '500'\n   WHEN c.FORTYPCD = 508 THEN '500'\n   WHEN c.FORTYPCD = 509 THEN '500'\n   WHEN c.FORTYPCD = 510 THEN '500'\n   WHEN c.FORTYPCD = 511 THEN '500'\n   WHEN c.FORTYPCD = 512 THEN '500'\n   WHEN c.FORTYPCD = 513 THEN '500'\n   WHEN c.FORTYPCD = 514 THEN '500'\n   WHEN c.FORTYPCD = 515 THEN '500'\n   WHEN c.FORTYPCD = 516 THEN '500'\n   WHEN c.FORTYPCD = 517 THEN '500'\n   WHEN c.FORTYPCD = 519 THEN '500'\n   WHEN c.FORTYPCD = 520 THEN '500'\n   WHEN c.FORTYPCD = 600 THEN '600'\n   WHEN c.FORTYPCD = 601 THEN '600'\n   WHEN c.FORTYPCD = 602 THEN '600'\n   WHEN c.FORTYPCD = 605 THEN '600'\n   WHEN c.FORTYPCD = 606 THEN '600'\n   WHEN c.FORTYPCD = 607 THEN '600'\n   WHEN c.FORTYPCD = 608 THEN '600'\n   WHEN c.FORTYPCD = 609 THEN '600'\n   WHEN c.FORTYPCD = 700 THEN '700'\n   WHEN c.FORTYPCD = 701 THEN '700'\n   WHEN c.FORTYPCD = 702 THEN '700'\n   WHEN c.FORTYPCD = 703 THEN '700'\n   WHEN c.FORTYPCD = 704 THEN '700'\n   WHEN c.FORTYPCD = 705 THEN '700'\n   WHEN c.FORTYPCD = 706 THEN '700'\n   WHEN c.FORTYPCD = 707 THEN '700'\n   WHEN c.FORTYPCD = 708 THEN '700'\n   WHEN c.FORTYPCD = 709 THEN '700'\n   WHEN c.FORTYPCD = 722 THEN '700'\n   WHEN c.FORTYPCD = 800 THEN '800'\n   WHEN c.FORTYPCD = 801 THEN '800'\n   WHEN c.FORTYPCD = 802 THEN '800'\n   WHEN c.FORTYPCD = 803 THEN '800'\n   WHEN c.FORTYPCD = 805 THEN '800'\n   WHEN c.FORTYPCD = 807 THEN '800'\n   WHEN c.FORTYPCD = 809 THEN '800'\n   WHEN c.FORTYPCD = 900 THEN '900'\n   WHEN c.FORTYPCD = 901 THEN '900'\n   WHEN c.FORTYPCD = 902 THEN '900'\n   WHEN c.FORTYPCD = 903 THEN '900'\n   WHEN c.FORTYPCD = 904 THEN '900'\n   WHEN c.FORTYPCD = 905 THEN '900'\n   WHEN c.FORTYPCD = 910 THEN '910'\n   WHEN c.FORTYPCD = 911 THEN '910'\n   WHEN c.FORTYPCD = 912 THEN '910'\n   WHEN c.FORTYPCD = 920 THEN '920'\n   WHEN c.FORTYPCD = 921 THEN '920'\n   WHEN c.FORTYPCD = 922 THEN '920'\n   WHEN c.FORTYPCD = 923 THEN '920'\n   WHEN c.FORTYPCD = 924 THEN '920'\n   WHEN c.FORTYPCD = 925 THEN '920'\n   WHEN c.FORTYPCD = 926 THEN '920'\n   WHEN c.FORTYPCD = 931 THEN '920'\n   WHEN c.FORTYPCD = 932 THEN '920'\n   WHEN c.FORTYPCD = 933 THEN '920'\n   WHEN c.FORTYPCD = 934 THEN '920'\n   WHEN c.FORTYPCD = 935 THEN '920'\n   WHEN c.FORTYPCD = 940 THEN '940'\n   WHEN c.FORTYPCD = 941 THEN '940'\n   WHEN c.FORTYPCD = 942 THEN '940'\n   WHEN c.FORTYPCD = 943 THEN '940'\n   WHEN c.FORTYPCD = 950 THEN '950'\n   WHEN c.FORTYPCD = 951 THEN '950'\n   WHEN c.FORTYPCD = 952 THEN '950'\n   WHEN c.FORTYPCD = 953 THEN '950'\n   WHEN c.FORTYPCD = 954 THEN '950'\n   WHEN c.FORTYPCD = 955 THEN '950'\n   WHEN c.FORTYPCD = 960 THEN '960'\n   WHEN c.FORTYPCD = 961 THEN '960'\n   WHEN c.FORTYPCD = 962 THEN '960'\n   WHEN c.FORTYPCD = 970 THEN '970'\n   WHEN c.FORTYPCD = 971 THEN '970'\n   WHEN c.FORTYPCD = 972 THEN '970'\n   WHEN c.FORTYPCD = 973 THEN '970'\n   WHEN c.FORTYPCD = 974 THEN '970'\n   WHEN c.FORTYPCD = 975 THEN '970'\n   WHEN c.FORTYPCD = 976 THEN '970'\n   WHEN c.FORTYPCD = 980 THEN '980'\n   WHEN c.FORTYPCD = 981 THEN '980'\n   WHEN c.FORTYPCD = 982 THEN '980'\n   WHEN c.FORTYPCD = 983 THEN '980'\n   WHEN c.FORTYPCD = 984 THEN '980'\n   WHEN c.FORTYPCD = 985 THEN '980'\n   WHEN c.FORTYPCD = 986 THEN '980'\n   WHEN c.FORTYPCD = 987 THEN '980'\n   WHEN c.FORTYPCD = 988 THEN '980'\n   WHEN c.FORTYPCD = 989 THEN '980'\n   WHEN c.FORTYPCD = 990 THEN '990'\n   WHEN c.FORTYPCD = 991 THEN '990'\n   WHEN c.FORTYPCD = 992 THEN '990'\n   WHEN c.FORTYPCD = 993 THEN '990'\n   WHEN c.FORTYPCD = 995 THEN '990'\n   WHEN c.FORTYPCD = 999 THEN '999' END) AS FORTYPGRPCD, 1 AS TOTAL\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN))"
#> 
#> $dbqueriesWITH$pltcondxadjWITH
#> [1] "WITH\npltids AS\n(SELECT 'VOL' AS POP_TYP, plta.CN, plta.ESTN_UNIT\nFROM pltassgnx plta \n WHERE plta.PLOT_STATUS_CD != 3),\n----- calculate plot-level adjustment factors\nSELECT pltids.CN,\n   COALESCE(1 / NULLIF(SUM(CONDPROP_UNADJ),0), 0) AS ADJ_FACTOR_COND,\n   COALESCE(1 / NULLIF(SUM(SUBPPROP_UNADJ),0), 0) AS ADJ_FACTOR_SUBP,\n   COALESCE(1 / NULLIF(SUM(MACRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MACR,\n   COALESCE(1 / NULLIF(SUM(MICRPROP_UNADJ),0), 0) AS ADJ_FACTOR_MICR\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN)\n WHERE c.COND_STATUS_CD <> 5\n GROUP BY pltids.CN, \n----- pltcondx\npltcondx AS\n(SELECT c.PLT_CN, c.CONDID, c.COND_NONSAMPLE_REASN_CD, c.CONDPROP_UNADJ, c.SUBPPROP_UNADJ, c.MICRPROP_UNADJ, c.MACRPROP_UNADJ, c.OWNCD, c.OWNGRPCD, c.RESERVCD, c.SITECLCD, c.STDORGCD, c.ADFORCD, c.LIVE_CANOPY_CVR_PCT, c.COND_STATUS_CD, c.NF_COND_STATUS_CD, c.FORTYPCD, c.STDSZCD, c.STDAGE, c.GSSTKCD, c.DSTRBCD1, c.DSTRBYR1, c.DSTRBCD2, c.DSTRBYR2, \n   (CASE\n   WHEN c.FORTYPCD = 100 THEN '100'\n   WHEN c.FORTYPCD = 101 THEN '100'\n   WHEN c.FORTYPCD = 102 THEN '100'\n   WHEN c.FORTYPCD = 103 THEN '100'\n   WHEN c.FORTYPCD = 104 THEN '100'\n   WHEN c.FORTYPCD = 105 THEN '100'\n   WHEN c.FORTYPCD = 120 THEN '120'\n   WHEN c.FORTYPCD = 121 THEN '120'\n   WHEN c.FORTYPCD = 122 THEN '120'\n   WHEN c.FORTYPCD = 123 THEN '120'\n   WHEN c.FORTYPCD = 124 THEN '120'\n   WHEN c.FORTYPCD = 125 THEN '120'\n   WHEN c.FORTYPCD = 126 THEN '120'\n   WHEN c.FORTYPCD = 127 THEN '120'\n   WHEN c.FORTYPCD = 128 THEN '120'\n   WHEN c.FORTYPCD = 129 THEN '120'\n   WHEN c.FORTYPCD = 140 THEN '140'\n   WHEN c.FORTYPCD = 141 THEN '140'\n   WHEN c.FORTYPCD = 142 THEN '140'\n   WHEN c.FORTYPCD = 150 THEN '150'\n   WHEN c.FORTYPCD = 151 THEN '150'\n   WHEN c.FORTYPCD = 160 THEN '160'\n   WHEN c.FORTYPCD = 161 THEN '160'\n   WHEN c.FORTYPCD = 162 THEN '160'\n   WHEN c.FORTYPCD = 163 THEN '160'\n   WHEN c.FORTYPCD = 164 THEN '160'\n   WHEN c.FORTYPCD = 165 THEN '160'\n   WHEN c.FORTYPCD = 166 THEN '160'\n   WHEN c.FORTYPCD = 167 THEN '160'\n   WHEN c.FORTYPCD = 168 THEN '160'\n   WHEN c.FORTYPCD = 170 THEN '170'\n   WHEN c.FORTYPCD = 171 THEN '170'\n   WHEN c.FORTYPCD = 172 THEN '170'\n   WHEN c.FORTYPCD = 180 THEN '180'\n   WHEN c.FORTYPCD = 181 THEN '180'\n   WHEN c.FORTYPCD = 182 THEN '180'\n   WHEN c.FORTYPCD = 183 THEN '180'\n   WHEN c.FORTYPCD = 184 THEN '180'\n   WHEN c.FORTYPCD = 185 THEN '180'\n   WHEN c.FORTYPCD = 200 THEN '200'\n   WHEN c.FORTYPCD = 201 THEN '200'\n   WHEN c.FORTYPCD = 202 THEN '200'\n   WHEN c.FORTYPCD = 203 THEN '200'\n   WHEN c.FORTYPCD = 220 THEN '220'\n   WHEN c.FORTYPCD = 221 THEN '220'\n   WHEN c.FORTYPCD = 222 THEN '220'\n   WHEN c.FORTYPCD = 223 THEN '220'\n   WHEN c.FORTYPCD = 224 THEN '220'\n   WHEN c.FORTYPCD = 225 THEN '220'\n   WHEN c.FORTYPCD = 226 THEN '220'\n   WHEN c.FORTYPCD = 240 THEN '240'\n   WHEN c.FORTYPCD = 241 THEN '240'\n   WHEN c.FORTYPCD = 260 THEN '260'\n   WHEN c.FORTYPCD = 261 THEN '260'\n   WHEN c.FORTYPCD = 262 THEN '260'\n   WHEN c.FORTYPCD = 263 THEN '260'\n   WHEN c.FORTYPCD = 264 THEN '260'\n   WHEN c.FORTYPCD = 265 THEN '260'\n   WHEN c.FORTYPCD = 266 THEN '260'\n   WHEN c.FORTYPCD = 267 THEN '260'\n   WHEN c.FORTYPCD = 268 THEN '260'\n   WHEN c.FORTYPCD = 269 THEN '260'\n   WHEN c.FORTYPCD = 270 THEN '260'\n   WHEN c.FORTYPCD = 271 THEN '260'\n   WHEN c.FORTYPCD = 280 THEN '280'\n   WHEN c.FORTYPCD = 281 THEN '280'\n   WHEN c.FORTYPCD = 300 THEN '300'\n   WHEN c.FORTYPCD = 301 THEN '300'\n   WHEN c.FORTYPCD = 304 THEN '300'\n   WHEN c.FORTYPCD = 305 THEN '300'\n   WHEN c.FORTYPCD = 320 THEN '320'\n   WHEN c.FORTYPCD = 321 THEN '320'\n   WHEN c.FORTYPCD = 340 THEN '340'\n   WHEN c.FORTYPCD = 341 THEN '340'\n   WHEN c.FORTYPCD = 342 THEN '340'\n   WHEN c.FORTYPCD = 360 THEN '360'\n   WHEN c.FORTYPCD = 361 THEN '360'\n   WHEN c.FORTYPCD = 362 THEN '360'\n   WHEN c.FORTYPCD = 363 THEN '360'\n   WHEN c.FORTYPCD = 364 THEN '360'\n   WHEN c.FORTYPCD = 365 THEN '360'\n   WHEN c.FORTYPCD = 366 THEN '360'\n   WHEN c.FORTYPCD = 367 THEN '360'\n   WHEN c.FORTYPCD = 368 THEN '360'\n   WHEN c.FORTYPCD = 369 THEN '360'\n   WHEN c.FORTYPCD = 370 THEN '370'\n   WHEN c.FORTYPCD = 371 THEN '370'\n   WHEN c.FORTYPCD = 380 THEN '380'\n   WHEN c.FORTYPCD = 381 THEN '380'\n   WHEN c.FORTYPCD = 382 THEN '380'\n   WHEN c.FORTYPCD = 383 THEN '380'\n   WHEN c.FORTYPCD = 384 THEN '380'\n   WHEN c.FORTYPCD = 385 THEN '380'\n   WHEN c.FORTYPCD = 390 THEN '390'\n   WHEN c.FORTYPCD = 391 THEN '390'\n   WHEN c.FORTYPCD = 400 THEN '400'\n   WHEN c.FORTYPCD = 401 THEN '400'\n   WHEN c.FORTYPCD = 402 THEN '400'\n   WHEN c.FORTYPCD = 403 THEN '400'\n   WHEN c.FORTYPCD = 404 THEN '400'\n   WHEN c.FORTYPCD = 405 THEN '400'\n   WHEN c.FORTYPCD = 406 THEN '400'\n   WHEN c.FORTYPCD = 407 THEN '400'\n   WHEN c.FORTYPCD = 409 THEN '400'\n   WHEN c.FORTYPCD = 500 THEN '500'\n   WHEN c.FORTYPCD = 501 THEN '500'\n   WHEN c.FORTYPCD = 502 THEN '500'\n   WHEN c.FORTYPCD = 503 THEN '500'\n   WHEN c.FORTYPCD = 504 THEN '500'\n   WHEN c.FORTYPCD = 505 THEN '500'\n   WHEN c.FORTYPCD = 506 THEN '500'\n   WHEN c.FORTYPCD = 507 THEN '500'\n   WHEN c.FORTYPCD = 508 THEN '500'\n   WHEN c.FORTYPCD = 509 THEN '500'\n   WHEN c.FORTYPCD = 510 THEN '500'\n   WHEN c.FORTYPCD = 511 THEN '500'\n   WHEN c.FORTYPCD = 512 THEN '500'\n   WHEN c.FORTYPCD = 513 THEN '500'\n   WHEN c.FORTYPCD = 514 THEN '500'\n   WHEN c.FORTYPCD = 515 THEN '500'\n   WHEN c.FORTYPCD = 516 THEN '500'\n   WHEN c.FORTYPCD = 517 THEN '500'\n   WHEN c.FORTYPCD = 519 THEN '500'\n   WHEN c.FORTYPCD = 520 THEN '500'\n   WHEN c.FORTYPCD = 600 THEN '600'\n   WHEN c.FORTYPCD = 601 THEN '600'\n   WHEN c.FORTYPCD = 602 THEN '600'\n   WHEN c.FORTYPCD = 605 THEN '600'\n   WHEN c.FORTYPCD = 606 THEN '600'\n   WHEN c.FORTYPCD = 607 THEN '600'\n   WHEN c.FORTYPCD = 608 THEN '600'\n   WHEN c.FORTYPCD = 609 THEN '600'\n   WHEN c.FORTYPCD = 700 THEN '700'\n   WHEN c.FORTYPCD = 701 THEN '700'\n   WHEN c.FORTYPCD = 702 THEN '700'\n   WHEN c.FORTYPCD = 703 THEN '700'\n   WHEN c.FORTYPCD = 704 THEN '700'\n   WHEN c.FORTYPCD = 705 THEN '700'\n   WHEN c.FORTYPCD = 706 THEN '700'\n   WHEN c.FORTYPCD = 707 THEN '700'\n   WHEN c.FORTYPCD = 708 THEN '700'\n   WHEN c.FORTYPCD = 709 THEN '700'\n   WHEN c.FORTYPCD = 722 THEN '700'\n   WHEN c.FORTYPCD = 800 THEN '800'\n   WHEN c.FORTYPCD = 801 THEN '800'\n   WHEN c.FORTYPCD = 802 THEN '800'\n   WHEN c.FORTYPCD = 803 THEN '800'\n   WHEN c.FORTYPCD = 805 THEN '800'\n   WHEN c.FORTYPCD = 807 THEN '800'\n   WHEN c.FORTYPCD = 809 THEN '800'\n   WHEN c.FORTYPCD = 900 THEN '900'\n   WHEN c.FORTYPCD = 901 THEN '900'\n   WHEN c.FORTYPCD = 902 THEN '900'\n   WHEN c.FORTYPCD = 903 THEN '900'\n   WHEN c.FORTYPCD = 904 THEN '900'\n   WHEN c.FORTYPCD = 905 THEN '900'\n   WHEN c.FORTYPCD = 910 THEN '910'\n   WHEN c.FORTYPCD = 911 THEN '910'\n   WHEN c.FORTYPCD = 912 THEN '910'\n   WHEN c.FORTYPCD = 920 THEN '920'\n   WHEN c.FORTYPCD = 921 THEN '920'\n   WHEN c.FORTYPCD = 922 THEN '920'\n   WHEN c.FORTYPCD = 923 THEN '920'\n   WHEN c.FORTYPCD = 924 THEN '920'\n   WHEN c.FORTYPCD = 925 THEN '920'\n   WHEN c.FORTYPCD = 926 THEN '920'\n   WHEN c.FORTYPCD = 931 THEN '920'\n   WHEN c.FORTYPCD = 932 THEN '920'\n   WHEN c.FORTYPCD = 933 THEN '920'\n   WHEN c.FORTYPCD = 934 THEN '920'\n   WHEN c.FORTYPCD = 935 THEN '920'\n   WHEN c.FORTYPCD = 940 THEN '940'\n   WHEN c.FORTYPCD = 941 THEN '940'\n   WHEN c.FORTYPCD = 942 THEN '940'\n   WHEN c.FORTYPCD = 943 THEN '940'\n   WHEN c.FORTYPCD = 950 THEN '950'\n   WHEN c.FORTYPCD = 951 THEN '950'\n   WHEN c.FORTYPCD = 952 THEN '950'\n   WHEN c.FORTYPCD = 953 THEN '950'\n   WHEN c.FORTYPCD = 954 THEN '950'\n   WHEN c.FORTYPCD = 955 THEN '950'\n   WHEN c.FORTYPCD = 960 THEN '960'\n   WHEN c.FORTYPCD = 961 THEN '960'\n   WHEN c.FORTYPCD = 962 THEN '960'\n   WHEN c.FORTYPCD = 970 THEN '970'\n   WHEN c.FORTYPCD = 971 THEN '970'\n   WHEN c.FORTYPCD = 972 THEN '970'\n   WHEN c.FORTYPCD = 973 THEN '970'\n   WHEN c.FORTYPCD = 974 THEN '970'\n   WHEN c.FORTYPCD = 975 THEN '970'\n   WHEN c.FORTYPCD = 976 THEN '970'\n   WHEN c.FORTYPCD = 980 THEN '980'\n   WHEN c.FORTYPCD = 981 THEN '980'\n   WHEN c.FORTYPCD = 982 THEN '980'\n   WHEN c.FORTYPCD = 983 THEN '980'\n   WHEN c.FORTYPCD = 984 THEN '980'\n   WHEN c.FORTYPCD = 985 THEN '980'\n   WHEN c.FORTYPCD = 986 THEN '980'\n   WHEN c.FORTYPCD = 987 THEN '980'\n   WHEN c.FORTYPCD = 988 THEN '980'\n   WHEN c.FORTYPCD = 989 THEN '980'\n   WHEN c.FORTYPCD = 990 THEN '990'\n   WHEN c.FORTYPCD = 991 THEN '990'\n   WHEN c.FORTYPCD = 992 THEN '990'\n   WHEN c.FORTYPCD = 993 THEN '990'\n   WHEN c.FORTYPCD = 995 THEN '990'\n   WHEN c.FORTYPCD = 999 THEN '999' END) AS FORTYPGRPCD, 1 AS TOTAL\n FROM pltids\n JOIN condx c ON (c.PLT_CN = pltids.CN))"
#> 
#> 
#> $pltassgnx
#> Key: <CN>
#>                   CN ESTN_UNIT        dem        tcc          tpi    tnt
#>               <char>    <fctr>      <num>      <num>        <num> <fctr>
#>    1: 40404728010690         1  0.8605029 -0.4883215  1.930461976      2
#>    2: 40404729010690         1  0.8807561 -0.1549622  0.158401977      2
#>    3: 40404730010690         1  0.6620211  2.5119114 -2.152005364      1
#>    4: 40404731010690         1  0.5182231 -0.4883215  0.001384002      2
#>    5: 40404733010690         1  0.6660718 -0.4883215  0.248126534      2
#>   ---                                                                   
#> 3043: 40407866010690        45 -1.4159615 -0.3549778  0.046246280      2
#> 3044: 40407867010690        45 -1.3389992 -0.4883215  0.539731344      2
#> 3045: 40407868010690        45 -1.3673537 -0.4883215  0.360282230      2
#> 3046: 40407869010690        45 -1.4949491 -0.4883215  0.248126534      2
#> 3047: 46792188020004        29  0.4412608  0.3784125  0.113539698      2
#>       PLOT_STATUS_CD       tnt2
#>                <int>      <num>
#>    1:              2  0.4328854
#>    2:              1  0.4328854
#>    3:              1 -2.3093221
#>    4:              2  0.4328854
#>    5:              2  0.4328854
#>   ---                          
#> 3043:              2  0.4328854
#> 3044:              2  0.4328854
#> 3045:              2  0.4328854
#> 3046:              2  0.4328854
#> 3047:              1  0.4328854
#> 
#> $unitlut
#>     ESTN_UNIT STATECD COUNTYCD        dem         tcc        tpi         tnt2
#>        <fctr>   <int>    <num>      <num>       <num>      <num>        <num>
#>  1:         1      56        1  0.6598451 -0.03141457 0.02410391 -0.042887844
#>  2:         3      56        3 -0.6063518  0.03853765 0.02375948  0.018075308
#>  3:         5      56        5 -1.1747311 -0.32445118 0.02392288  0.354126836
#>  4:         7      56        7  0.5592886  0.01329258 0.02386679 -0.013807115
#>  5:         9      56        9 -0.5938230 -0.25765696 0.02366908  0.198092337
#>  6:        11      56       11 -1.3094397  0.40230718 0.02371708 -0.313472854
#>  7:        13      56       13  0.3972305 -0.06168731 0.02355032 -0.008444611
#>  8:        15      56       15 -1.0811447 -0.39829389 0.02385520  0.380809162
#>  9:        17      56       17 -0.1489854 -0.21369211 0.02429740 -0.020315265
#> 10:        19      56       19 -0.5102112  0.14107300 0.02396383 -0.046262537
#> 11:        21      56       21 -0.2463118 -0.41499575 0.02376571  0.396036366
#> 12:        23      56       23  0.6245413  0.37904477 0.02373278 -0.299005826
#> 13:        25      56       25 -0.1923341 -0.35050535 0.02401586  0.301923399
#> 14:        27      56       27 -1.1468399 -0.42551939 0.02391425  0.304101296
#> 15:        29      56       29  0.6983394  0.61652010 0.02383676 -0.728038041
#> 16:        31      56       31 -0.7592113 -0.26690880 0.02369780  0.226691002
#> 17:        33      56       33 -0.7626303  0.49425044 0.02387319 -0.345621625
#> 18:        35      56       35  1.0107771  0.21888086 0.02454527 -0.222879790
#> 19:        37      56       37  0.2924267 -0.43402957 0.02382172  0.391209881
#> 20:        39      56       39  1.0255653  1.48278434 0.02372393 -1.312464307
#> 21:        41      56       41  0.5315508 -0.15177307 0.02359849  0.133340723
#> 22:        43      56       43 -0.7130302 -0.14297623 0.02342656  0.156749635
#> 23:        45      56       45 -1.1930271 -0.20750101 0.02353014  0.125040286
#>     ESTN_UNIT STATECD COUNTYCD        dem         tcc        tpi         tnt2
#>     n.total
#>       <int>
#>  1:     133
#>  2:      98
#>  3:     152
#>  4:     245
#>  5:     133
#>  6:      85
#>  7:     290
#>  8:      70
#>  9:      58
#> 10:     128
#> 11:      86
#> 12:     132
#> 13:     175
#> 14:      79
#> 15:     216
#> 16:      64
#> 17:      82
#> 18:     158
#> 19:     339
#> 20:     125
#> 21:      63
#> 22:      63
#> 23:      73
#>     n.total
#> 
#> $unitarea
#> Key: <ESTN_UNIT>
#>     ESTN_UNIT   ACRES
#>         <num>   <num>
#>  1:         1 2757613
#>  2:         3 2021729
#>  3:         5 3072988
#>  4:         7 5096959
#>  5:         9 2729653
#>  6:        11 1837124
#>  7:        13 5930088
#>  8:        15 1428579
#>  9:        17 1283969
#> 10:        19 2671802
#> 11:        21 1720074
#> 12:        23 2616954
#> 13:        25 3440445
#> 14:        27 1681849
#> 15:        29 4459826
#> 16:        31 1350969
#> 17:        33 1617318
#> 18:        35 3158807
#> 19:        37 6714319
#> 20:        39 2701941
#> 21:        41 1336034
#> 22:        43 1435352
#> 23:        45 1536038
#>     ESTN_UNIT   ACRES
#> 
#> $npixels
#>     ESTN_UNIT npixels
#>         <num>   <num>
#>  1:         1 1376714
#>  2:         3 1010229
#>  3:         5 1538394
#>  4:         7 2546066
#>  5:         9 1362852
#>  6:        11  915454
#>  7:        13 2961420
#>  8:        15  713352
#>  9:        17  641459
#> 10:        19 1334190
#> 11:        21  859967
#> 12:        23 1308662
#> 13:        25 1720554
#> 14:        27  841523
#> 15:        29 2228161
#> 16:        31  675011
#> 17:        33  807188
#> 18:        35 1577267
#> 19:        37 3355881
#> 20:        39 1349166
#> 21:        41  668120
#> 22:        43  717122
#> 23:        45  767376
#>     ESTN_UNIT npixels
#> 
#> $npixelvar
#> [1] "npixels"
#> 
#> $estvar.area
#> [1] "CONDPROP_ADJ"
#> 
#> $areavar
#> [1] "ACRES"
#> 
#> $areaunits
#> [1] "acres"
#> 
#> $unitvar
#> [1] "ESTN_UNIT"
#> 
#> $unitvars
#> [1] "ESTN_UNIT"
#> 
#> $plotsampcnt
#> data frame with 0 columns and 0 rows
#> 
#> $condsampcnt
#>    COND_STATUS_NM COND_STATUS_CD NBRCONDS
#> 1  Nonforest land              2     2590
#> 2     Forest land              1      590
#> 3 Noncensus water              3       10
#> 4      Nonsampled              5       14
#> 5    Census water              4       20
#> 
#> $states
#> [1] "Wyoming"
#> 
#> $invyrs
#> NULL
#> 
#> $adj
#> [1] "plot"
#> 
#> $P2POINTCNT
#> data frame with 0 columns and 0 rows
#> 
#> $plotunitcnt
#>    ESTN_UNIT NBRPLOTS
#> 1          1      133
#> 2          3       98
#> 3          5      152
#> 4          7      245
#> 5          9      133
#> 6         11       85
#> 7         13      290
#> 8         15       70
#> 9         17       58
#> 10        19      128
#> 11        21       86
#> 12        23      132
#> 13        25      175
#> 14        27       79
#> 15        29      216
#> 16        31       64
#> 17        33       82
#> 18        35      158
#> 19        37      339
#> 20        39      125
#> 21        41       63
#> 22        43       63
#> 23        45       73
#> 
#> $treex
#> Key: <PLT_CN, CONDID, SUBP, TREE>
#>                PLT_CN CONDID  SUBP  TREE STATUSCD  SPCD SPGRPCD   DIA    HT
#>                <char>  <num> <num> <num>    <num> <num>   <num> <num> <num>
#>     1: 40404729010690      1     1     1        2   113      24   7.7    18
#>     2: 40404729010690      1     1     2        1    66      23  10.8    14
#>     3: 40404729010690      1     1     3        2   113      24   5.2    23
#>     4: 40404729010690      1     1     4        1   113      24   5.2    18
#>     5: 40404729010690      1     3     1        1   113      24   8.8    21
#>    ---                                                                     
#> 18570: 46792188020004      1     4    13        1   202      10   7.0    26
#> 18571: 46792188020004      1     4    14        2   202      10  11.4    53
#> 18572: 46792188020004      1     4    15        2   202      10  10.6    46
#> 18573: 46792188020004      1     4    16        2   202      10   6.3    41
#> 18574: 46792188020004      1     4    17        1   202      10   1.9     8
#>        TREECLCD AGENTCD STANDING_DEAD_CD  VOLCFNET  VOLCFGRS VOLBFNET TPA_UNADJ
#>           <num>   <num>            <num>     <num>     <num>    <num>     <num>
#>     1:        3      10                1  1.001201  1.820365       NA  6.018046
#>     2:        3      NA               NA        NA        NA       NA  6.018046
#>     3:        3      10                1  0.466414  0.848025       NA  6.018046
#>     4:        2      NA               NA  0.630180  0.630180       NA  6.018046
#>     5:        3      NA               NA  2.491559  2.931246       NA  6.018046
#>    ---                                                                         
#> 18570:        2      NA               NA  2.181686  2.181686       NA  6.018046
#> 18571:        3      NA                1 12.909056 12.909056       NA  6.018046
#> 18572:        3      NA                1  9.630596  9.630596       NA  6.018046
#> 18573:        3      NA                1  2.806583  2.806583       NA  6.018046
#> 18574:        3      NA               NA        NA        NA       NA 74.965282
#>         DRYBIO_AG  CARBON_AG tadjfac
#>             <num>      <num>   <num>
#>     1:  68.327405  34.437012       1
#>     2: 128.287031  61.192914       1
#>     3:  40.245848  20.283907       1
#>     4:  40.612073  19.493795       1
#>     5: 144.251149  69.240551       1
#>    ---                              
#> 18570: 115.692997  59.697586       1
#> 18571: 375.856438 190.183357       1
#> 18572: 270.737020 136.992932       1
#> 18573:  97.948647  49.562015       1
#> 18574:   3.145158   1.622902       1
#> 
#> $tuniqueid
#> [1] "PLT_CN"
#> 
#> $adjtree
#> [1] FALSE
#> 
#> $seedx
#> Key: <PLT_CN, CONDID, SUBP>
#>               PLT_CN  SUBP CONDID  SPCD SPGRPCD  TPA_UNADJ TREECOUNT
#>               <char> <num>  <num> <num>   <num>      <num>     <num>
#>    1: 40404729010690     2      1   113      24   74.96528         1
#>    2: 40404730010690     2      1   202      10  224.89585         3
#>    3: 40404738010690     2      1   746      44 2323.92376        31
#>    4: 40404738010690     4      1    19      12   74.96528         1
#>    5: 40404738010690     4      1   113      24   74.96528         1
#>   ---                                                               
#> 1603: 40407815010690     1      1   313      47  224.89585         3
#> 1604: 40407831010690     1      1   122      11 4497.91695        60
#> 1605: 46792188020004     2      1   202      10  374.82641         5
#> 1606: 46792188020004     3      1   202      10  299.86113         4
#> 1607: 46792188020004     4      1   202      10  224.89585         3
#>       TREECOUNT_CALC tadjfac
#>                <num>   <num>
#>    1:              1       1
#>    2:              3       1
#>    3:             31       1
#>    4:              1       1
#>    5:              1       1
#>   ---                       
#> 1603:              3       2
#> 1604:             60       1
#> 1605:              5       1
#> 1606:              4       1
#> 1607:              3       1
#> 
#> $adjfactors
#> Key: <CN>
#>                   CN ADJ_FACTOR_COND ADJ_FACTOR_SUBP ADJ_FACTOR_MACR
#>               <char>           <num>           <num>           <int>
#>    1: 40404728010690               1               1               0
#>    2: 40404729010690               1               1               0
#>    3: 40404730010690               1               1               0
#>    4: 40404731010690               1               1               0
#>    5: 40404733010690               1               1               0
#>   ---                                                               
#> 3043: 40407866010690               1               1               0
#> 3044: 40407867010690               1               1               0
#> 3045: 40407868010690               1               1               0
#> 3046: 40407869010690               1               1               0
#> 3047: 46792188020004               1               1               0
#>       ADJ_FACTOR_MICR
#>                 <num>
#>    1:               1
#>    2:               1
#>    3:               1
#>    4:               1
#>    5:               1
#>   ---                
#> 3043:               1
#> 3044:               1
#> 3045:               1
#> 3046:               1
#> 3047:               1
#> 
#> $adjvarlst
#>              COND              SUBP              MACR              MICR 
#> "ADJ_FACTOR_COND" "ADJ_FACTOR_SUBP" "ADJ_FACTOR_MACR" "ADJ_FACTOR_MICR" 
#> 
#> $prednames
#> [1] "dem"  "tcc"  "tpi"  "tnt2"
#> 
#> $predfac
#> [1] "tnt"
#> 
#> $popdatindb
#> [1] FALSE
#> 
# }