NavigationUser login |
dylan's blogsoilDB Demo: Processing SSURGO Attribute Data with SDA_query()Submitted by dylan on Thu, 2012-04-26 23:18.
A quick example of how to use the USDA-NRCS soil data access query facility (SDA), via the soilDB package for R. The following code describes how to get component-level soils data for Yolo County (survey area CA113) from SDA and compute representative sub-order level classification for each map unit. This example requires an understanding of SQL, US Soil Taxonomy and the SSURGO database. ( categories: )
R Quickie: Custom Panel Functions and Default ArgumentsSubmitted by dylan on Mon, 2012-04-16 16:39.
Sometimes the basic functionality in lattice graphics isn't enough. Custom "panel functions" are one approach to fully customizing the lattice graphics system. Two examples are given below illustrating how to define an (inline) custom panel function for adding a regression line to an entire data set in the presence of grouping variable. The "..." keyword instructs our custom panel function to accept all arguments typically passed to a panel function, and can be re-used in clever ways within our panel function. AQP Kick-StartSubmitted by dylan on Wed, 2012-03-28 02:41.
A fun kick-starter for anyone interested in working with soil profile data in R, via AQP. See in-line comments for details. Up next, profile slicing and aggregation. ( categories: )
Dissimilarity Between Soil Profiles: A Closer LookSubmitted by dylan on Fri, 2012-03-23 19:35.
Continuing the previous discussion of pair-wise dissimilarity between soil profiles, the following demonstration (code, comments, and figures) further elaborates on the method. A more in-depth discussion of this example will be included as a vignette within the 1.0 release of AQP. ( categories: )
A Graphical Explanation of how to Interpret a DendrogramSubmitted by dylan on Thu, 2012-03-15 18:16.
Dendrograms are a convenient way of depicting pair-wise dissimilarity between objects, commonly associated with the topic of cluster analysis. This is a complex subject that is best left to experts and textbooks, so I won't even attempt to cover it here. I have been frequently using dendrograms as part of my investigations into dissimilarity computed between soil profiles. Unfortunately the interpretation of dendrograms is not very intuitive, especially when the source data are complex. In addition, pair-wise dissimimlarity computed between soil profiles and visualized via dendrogram should not be confused with the use of dendrograms in the field of cladistics-- where relation to a common ancestor is depicted. An example is presented below that illustrates the relationship between dendrogram and dissimilarity as evaluated between objects with 2 variables. Essentially, the level at which branches merge (relative to the "root" of the tree) is related to their similarity. In the example below it is clear that (in terms of clay and rock fragment content) soils 4 and 5 are more similar to each other than to soil 2. In addition, soils 1 and 3 are more similar to each other than soils 4 and 5 are to soil 2. Recall that in this case pair-wise dissimilarity is based on the Euclidean distance between soils in terms of their clay content and rock fragment content. Therefore proximity in the scatter plot of frock frags vs. clay is directly related to our simple evaluation of "dissimilarity". Inline-comments in the code below elaborate further. ( categories: )
AQP / soilDB Demo: Dueling DendrogramsSubmitted by dylan on Wed, 2012-03-14 21:55.
Previously, soil profile comparison methods from the aqp package only took into account horizon-level attributes. As of last week the profile_compare() function can now accommodate horizon and site-level attributes. In other words, it is now possible to compute pair-wise dissimilarity between soil profiles using a combination of horizon-level properties (soil texture, pH, color, etc.) and site-level properties (surface slope, vegetation, soil taxonomy, etc.)-- continuous, categorical, or boolean. An example is presented below which is based on the loafercreek sample data set included with the soilDB package. Be sure to use the latest version of soilDB, 0.5-5 or later. Dissimilarity matrices created from horizon and site+horizon data are compared by placing their respective dendrograms back-to-back. Code from the ape package is used to facilitate dendrogram plotting, manipulation, and indexing. Blue line segments connect matching nodes from each dendrogram. Soil profiles with paralithic contact are marked with orange squares for clarity. ( categories: )
AQP Demo: Interfacing with PedonPC Databases using the 'soilDB' PackageSubmitted by dylan on Thu, 2012-02-23 19:09.
Here is a quick, draft demo on extracting soils data from a PedonPC database, and performing some common analysis with functions from AQP. The newly released soilDB package makes it possible to rapidly extract soils data from PedonPC, local NASIS, and SDA. Thanks to Jay Skovlin for his contributions to this package and his knowledge regarding the structure of these databases. The soilDB package will arrive on CRAN by the end of the week, and a more complete demo should be ready soon. These examples can be run offline, on a non-Windows computer, or without the soilDB package-- by downloading the attached Rda file at the bottom of the page. Unfortunately the PedonPC and local NASIS connectivity only works on Windows- sorry. SDA queries should work on any platform. Windows binary packages for the dependencies can be found here. ( categories: )
A Quick Demo of SoilProfileCollection Methods and Plotting FunctionsSubmitted by dylan on Wed, 2012-01-04 20:02.
Here is a quick demo of some of the new functionality in AQP as of version 0.99-9.2. The demos below are based on soil profiles from an archive described in (Carre and Girard, 2002) available on the OSACA page. A condensed version of the collection is available as a SoilProfileCollection object in the AQP sample dataset "sp5". UPDATE 2010-01-12 Syntax has changed slightly, as profileApply() now iterates over a list of SoilProfileCollection objects, one for each profile from the original object. AQP 0.9-9 is ready: 1.0 should be out by 2012-01-01 !Submitted by dylan on Thu, 2011-12-22 19:33.
Version 1.0 of AQP is nearly ready-- after nearly 3 years of development, 2 years on R-Forge, and 1+ year on CRAN. Just pushed version 0.9-9 to R-Forge, and it should be on CRAN within a couple days. Recent changes are listed below, clipped from the NEWS file. ( categories: )
Logistic Power Peak (LPP) Simulated Soil ProfilesSubmitted by dylan on Sat, 2011-11-12 21:01.
A friend of mine recently published a very interesting article on the pedologic interpretation of asymetric peak functions fit to soil profile data (Myers et al., 2011). I won't bother summarizing or paraphrasing the article here, as the original article is very accessible, rather I thought I would share some new functionality in AQP that was inspired by the article. While reading the article I thought that it would be interesting to use one of these peak functions, the logistic power peak (LPP) function, to simulate soil property depth-functions. Simulated values could be used to evaluate new algorithms with a set of tightly controlled properties that vary with depth. One of the nice aspects of these peak functions is that they can create a wide range of shapes that mimic common anisotropic depth-functions associated with pedogenic processes such as illuviation, ferrolysis, or seasonal fluctuation of groundwater levels. An example R session demonstrating the use of LPP-simulated soil property depth-functions is presented below. ( categories: )
|