knitr::opts_chunk$set(echo = TRUE) # set options

#packages
library(knitr)
library(RODBC)
library(nwos)

#download data
TABLES <- sqlQuery64("SELECT * FROM FS_NWOS.TABLES")
FIELDS <- sqlQuery64("SELECT * FROM FS_NWOS.FIELDS")
CODES <- sqlQuery64("SELECT * FROM FS_NWOS.CODES")

TABLES <- TABLES[order(TABLES$TABLE_NAME),] #reorder
FIELDS <- FIELDS[order(FIELDS$TABLE_NAME,FIELDS$COLUMN),]
CODES <- CODES[order(CODES$TABLE_NAME,CODES$FIELD_NAME,as.numeric(CODES$CODE)),]

Introduction

This document contains a current and up-to-date catalog of tables, fields, and codes in the NWOS Database (NWOS-DB).

Tables

The DB contains r nrow(TABLES) tables, including administrative tables and survey tables, those tables containing information about the sampling frame, survey organization, and raw data.

kable(TABLES[,c("TABLE_NAME","DESCRIPTION","TYPE")],row.names=F)

Fields

The DB contains r nrow(FIELDS) individual fields among the r nrow(TABLES) tables.

kable(FIELDS[,c("TABLE_NAME","FIELD_NAME","DESCRIPTION","DATA_TYPE")],row.names=F)

Codes

r length(unique(CODES$FIELD_CN)) fields in the DB have coded values.

kable(CODES[,c("TABLE_NAME","FIELD_NAME","CODE","MEANING")],row.names=F)


familyforestresearchcenter/nwos documentation built on April 12, 2025, 11:54 a.m.