knitr::opts_chunk$set(echo = TRUE)

options(stringsAsFactors = FALSE) 
library(knitr)
library(tidyverse)
library(RODBC)  #NOTE you must use 32 bit R for this to work

Introduction

Field |units | Definition ---------------- | ------------- | ------------------------------------------------------------------------------------------ NLA_ID | |NLA2007 unique identifier BufWidthM |m |width of lake buffer for calculations Pop | people |number of people in the buffer PopDensityKm2 |People/Km2 | Pop/BufferAreaKm2Adj BufferAreaKm2 |Km2 |Area of entire buffer-number of grid cells3030/1000000 BufferAreaKm2Adj |Km2 |Area of Non-NA buffer-number of grid cells with data3030/1000000 PercentNA |% |(number of NA grid cells)/(total number of grid cells) BufType | |"Fixed" = standard buffer width; "Radius" buffer width = radius of a circle with Area = lake area.

# Read data-****Make Sure the Path Is Correct****
con <- odbcConnectAccess("L:/Public/Milstead_Lakes/WaterbodyDatabase/WaterbodyDatabase.mdb")
census <- sqlQuery(con, "
SELECT tblJoinNLAID_WBID.NLA_ID, LakeCensus2000Population.BufWidthM, LakeCensus2000Population.Pop, LakeCensus2000Population.PopDensityKm2, LakeCensus2000Population.BufferAreaKm2, LakeCensus2000Population.BufferAreaKm2Adj, LakeCensus2000Population.PercentNA, LakeCensus2000Population.BufType
FROM tblJoinNLAID_WBID INNER JOIN LakeCensus2000Population ON tblJoinNLAID_WBID.WB_ID = LakeCensus2000Population.WB_ID;
")
close(con)
str(census)

write.csv(census,'nla_2007_census.csv',row.names=FALSE)


willbmisled/lakescape documentation built on May 5, 2019, 9:03 p.m.