plotTransect {sharpshootR} | R Documentation |
Plot a collection of Soil Profiles linked to their position along some gradient (e.g. transect).
plotTransect(s, grad.var.name, transect.col = "RoyalBlue", tick.number=7, y.offset = 100, scaling.factor = 0.5, distance.axis.title = "Distance Along Transect (km)", crs = NULL, grad.axis.title = NULL, ...)
s |
a |
grad.var.name |
the name of a site-level attribute containing gradient values |
transect.col |
color used to plot gradient (transect) values |
tick.number |
number of desired ticks and labels on the gradient axis |
y.offset |
vertical offset used to position profile sketches |
scaling.factor |
scaling factor used to adjust profile sketches |
distance.axis.title |
a tital for the along-transect distances |
crs |
an optional |
grad.axis.title |
a title for the gradient axis |
... |
further arguments passed to |
Depending on the nature of your SoilProfileCollection and associated gradient values, it may be necessary to tinker with figure margins, y.offset
and scaling.factor
.
An invisibly-returned data.frame
object:
scaled gradient values
cumulative distance, scaled to the interval of 0.5, nrow(coords) + 0.5
cumulative distance computed along gradient, e.g. transect distance
sorted gradient values
x coordinates, ordered by gradient values
y coordinate, ordered by gradient values
a vector index describing the sort order defined by gradient values
This function is very much a work in progress, ideas welcome!
D.E. Beaudette
## Not run:
##D data(loafercreek, package='soilDB')
##D
##D x <- loafercreek[1:10, ]
##D coordinates(x) <- ~ x_std + y_std
##D proj4string(x) <- '+proj=longlat +datum=NAD83'
##D
##D par(mar=c(4,3,1,1))
##D plotTransect(x, 'elev_field', crs=CRS('+proj=utm +zone=10 +datum=NAD83'), max.depth=185)
## End(Not run)