This document describes how to setup an ODBC link between R and the local NASIS database.
nasis_local. A data source description is optional.
The NASIS SQL server name is in the format
XXXXXX is your “computer name”
NASISSQLEXPRESS is the local NASIS SQL Express server.
Your computer name is often on the asset tag sticker on the outside of your computer.
On Windows 10, you can view your computer name by opening the Control Panel and selecting “System” OR by searching “This PC” in the Start Menu, right-clicking it, and selecting “Properties” . You need the value found under “Computer name:” (highlighted below).
ARCCASON5000002– where state, office and number will vary from computer to computer. Be very careful when typing it in! This is a common source of error in setting up ODBC connection.
When you are done, you will have something similar to what was as entered on the form above:
When finished click “Next”.
Choose the THIRD option: “With SQL Server authentication using a login ID and password entered by the user”
Enter Login ID and password. Don’t try and re-type these, just copy/paste
Click “Next” and then “Finish”. If you would like, you can test the connection to make sure it works.
Close the ODBC control panel by clicking ‘OK’
If you are doing this as part of a pre-course assignment, you do not need to do the following optional demonstration. However, it is a good way to verify everything is working correctly. You can return back to the assignment, but contact your mentor if you have any trouble.
soilDBand set up USDA-NRCS / NCSS soil packages
Install soil-themed packages and their dependencies using the commands below if you have not done so already.
# stable version from CRAN + dependencies install.packages("aqp", dependencies = TRUE) install.packages("soilDB", dependencies = TRUE) install.packages("sharpshootR", dependencies = TRUE) # database packages (replacement for RODBC) install.packages(c("DBI","odbc","RSQLite"), dependencies = TRUE) # latest version off GitHub remotes::install_github("ncss-tech/aqp", dependencies = FALSE, upgrade = FALSE, build = FALSE) remotes::install_github("ncss-tech/soilDB", dependencies = FALSE, upgrade = FALSE, build = FALSE) remotes::install_github("ncss-tech/sharpshootR", dependencies = FALSE, upgrade = FALSE, build = FALSE)
After installing the above packages, load some pedons into your local database and selected set. Use a NASIS query such as POINT - Pedon/Site/NCSSlabdata by upedonid and taxonname in NSSC Pangaea.
Then, try loading them into your R session and making a “sketch” of the profiles.
If you want to do more with SoilProfileCollections, profile sketches, and soil data wrangling check out some of the tutorials on the AQP website.
Details on loading NASIS data into R can be found in this tutorial.