diff --git a/docs/404.html b/docs/404.html index d85ca758..7f042d05 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,66 +1,27 @@ - - - - + + + + - Page not found (404) • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - -
-
- + +
+ + + - - -
+
+
-
+ + - - diff --git a/docs/authors.html b/docs/authors.html index 73697dd0..4aa381cb 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,66 +1,12 @@ - - - - - - - -Authors • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Authors and Citation • sharpshootR - + + - - - - -
-
-
- -
+
- @@ -135,22 +95,20 @@

Authors

-
- +
- - + + diff --git a/docs/index.html b/docs/index.html index 49e130f2..cd4b76f8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -19,6 +19,8 @@ + +
- - -
+
-
data(CDEC.snow.courses)
+
+
data(CDEC.snow.courses)
+
+ +
+

Format

+

A data frame with 259 observations on the following 9 variables.

course_number
+

course number

+ +
name
+

connotative course label

+
id
+

course ID

-

Format

+
elev_feet
+

course elevation in feet

+ +
latitude
+

latitude

+ +
longitude
+

longitude

+ +
april.1.Avg.inches
+

average inches of snow as of April 1st

+ +
agency
+

responsible agency

+ +
watershed
+

watershed label

-

A data frame with 259 observations on the following 9 variables.

-
course_number

course number

-
name

connotative course label

-
id

course ID

-
elev_feet

course elevation in feet

-
latitude

latitude

-
longitude

longitude

-
april.1.Avg.inches

average inches of snow as of April 1st

-
agency

responsible agency

-
watershed

watershed label

-
- -

Source

- -

Data were scraped from http://cdec.water.ca.gov/misc/SnowCourses.html, 2019.

- -

Examples

-
data(CDEC.snow.courses) -head(CDEC.snow.courses) -
#> course_number name id elev_feet latitude longitude -#> 2 1 PARKS CREEK PRK 6700 41.367 -122.550 -#> 3 2 LITTLE SHASTA LSH 6200 41.808 -122.195 -#> 4 3 SWEETWATER SWT 5850 41.382 -122.535 -#> 6 5 MIDDLE BOULDER 1 MBL 6600 41.217 -122.807 -#> 7 417 BOX CAMP BXC 6450 41.597 -123.165 -#> 8 311 MIDDLE BOULDER 3 MB3 6200 41.225 -122.811 -#> april.1.Avg.inches agency watershed -#> 2 35.1 Mount Shasta Ranger District SHASTA R -#> 3 16.6 Goosenest Ranger District SHASTA R -#> 4 13.1 Mount Shasta Ranger District SHASTA R -#> 6 31.5 Salmon/Scott River Ranger District SCOTT R -#> 7 35.2 Salmon/Scott River Ranger District SCOTT R -#> 8 27.4 Salmon/Scott River Ranger District SCOTT R
+
+
+

Source

+

Data were scraped from http://cdec.water.ca.gov/misc/SnowCourses.html, 2019.

+
+ +
+

Examples

+
data(CDEC.snow.courses)
+head(CDEC.snow.courses)
+#>   course_number             name  id elev_feet latitude longitude
+#> 2             1      PARKS CREEK PRK      6700   41.367  -122.550
+#> 3             2    LITTLE SHASTA LSH      6200   41.808  -122.195
+#> 4             3       SWEETWATER SWT      5850   41.382  -122.535
+#> 6             5 MIDDLE BOULDER 1 MBL      6600   41.217  -122.807
+#> 7           417         BOX CAMP BXC      6450   41.597  -123.165
+#> 8           311 MIDDLE BOULDER 3 MB3      6200   41.225  -122.811
+#>   april.1.Avg.inches                             agency watershed
+#> 2               35.1       Mount Shasta Ranger District  SHASTA R
+#> 3               16.6          Goosenest Ranger District  SHASTA R
+#> 4               13.1       Mount Shasta Ranger District  SHASTA R
+#> 6               31.5 Salmon/Scott River Ranger District   SCOTT R
+#> 7               35.2 Salmon/Scott River Ranger District   SCOTT R
+#> 8               27.4 Salmon/Scott River Ranger District   SCOTT R
+
+
+
-
- +
- - + + diff --git a/docs/reference/CDEC_StationInfo.html b/docs/reference/CDEC_StationInfo.html index fdcdb570..1f61d537 100644 --- a/docs/reference/CDEC_StationInfo.html +++ b/docs/reference/CDEC_StationInfo.html @@ -1,67 +1,12 @@ - - - - - - - -CDEC Sensor Details (by Station) — CDEC_StationInfo • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -CDEC Sensor Details (by Station) — CDEC_StationInfo • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,162 +52,56 @@

CDEC Sensor Details (by Station)

Query CDEC Website for Sensor Details

-
CDEC_StationInfo(s)
- -

Arguments

- - - - - - -
s

character, a single CDEC station ID (e.g. 'HHM')

+
+
CDEC_StationInfo(s)
+
-

Value

+
+

Arguments

+
s
+

character, a single CDEC station ID (e.g. 'HHM')

-

A list object containing site metadata, sensor metadata, and possibly comments about the site.

-

Details

+
+
+

Value

+ +

A list object containing site metadata, sensor metadata, and possibly comments about the site.

+
+
+

Details

This function requires the rvest package.

-

See also

- -

[CDECquery]

-

Author

- +
+
+

See also

+

[CDECquery]

+
+
+

Author

D.E. Beaudette

+
-

Examples

-
-# \donttest{ -if(requireNamespace("curl") & - curl::has_internet() -) { - - # CDEC API needs a long timeout - options(timeout = 60000) - - CDEC_StationInfo('HHM') - -} -
#> $site.meta -#> Station ID River Basin Hydrologic Area Latitude -#> 1 HHM MOKELUMNE R SAN JOAQUIN RIVER 38.49066 -#> Operator Elevation County Nearby City -#> 1 CA Dept of Water Resources/DFM-Hydro-SMN 8700 ALPINE BEAR VALLEY -#> Longitude Maintenance Name -#> 1 119.8056 CA Dept of Water Resources/DFM-Hydro-SMN HIGHLAND MEADOW -#> -#> $sensor.meta -#> sensor_details sensor interval sensor_name -#> 1 PRECIPITATION, ACCUMULATED, INCHES 2 (daily) (RAIN) -#> 2 PRECIPITATION, INCREMENTAL, INCHES 45 (daily) (PPT INC) -#> 3 SNOW, WATER CONTENT, INCHES 3 (daily) (SNOW WC) -#> 4 SNOW, WATER CONTENT(REVISED), INCHES 82 (daily) (SNO ADJ) -#> 5 TEMPERATURE, AIR AVERAGE, DEG F 30 (daily) (TEMP AV) -#> 6 TEMPERATURE, AIR MAXIMUM, DEG F 31 (daily) (TEMP MX) -#> 7 TEMPERATURE, AIR MINIMUM, DEG F 32 (daily) (TEMP MN) -#> 8 ATMOSPHERIC PRESSURE, INCHES 17 (event) (BAR PRE) -#> 9 BATTERY VOLTAGE, VOLTS 14 (event) (BAT VOL) -#> 10 PRECIPITATION, ACCUMULATED, INCHES 2 (event) (RAIN) -#> 11 REFLECTED IRRADIANCE AVG, W/M^2 119 (event) (RIRR AV) -#> 12 RELATIVE HUMIDITY, % 12 (event) (REL HUM) -#> 13 SNOW DEPTH, INCHES 18 (event) (SNOW DP) -#> 14 SNOW, WATER CONTENT, INCHES 3 (event) (SNOW WC) -#> 15 SOIL MOISTR, DEPTH 1, % 197 (event) (SOILMD1) -#> 16 SOIL MOISTR, DEPTH 2, % 198 (event) (SOILMD2) -#> 17 SOIL MOISTR, DEPTH 3, % 199 (event) (SOILMD3) -#> 18 SOIL TEMP, DEPTH 1, DEG F 194 (event) (SOILTD1) -#> 19 SOIL TEMP, DEPTH 2, DEG F 195 (event) (SOILTD2) -#> 20 SOIL TEMP, DEPTH 3, DEG F 196 (event) (SOILTD3) -#> 21 SOLAR RADIATION, W/M^2 26 (event) (SOLAR R) -#> 22 TEMPERATURE, AIR, DEG F 4 (event) (TEMP) -#> 23 WIND, DIRECTION, DEG 10 (event) (WIND DR) -#> 24 WIND, SPEED, MPH 9 (event) (WIND SP) -#> 25 BATTERY VOLTAGE, VOLTS 14 (hourly) (BAT VOL) -#> 26 PRECIPITATION, ACCUMULATED, INCHES 2 (hourly) (RAIN) -#> 27 SNOW, WATER CONTENT, INCHES 3 (hourly) (SNOW WC) -#> 28 TEMPERATURE, AIR, DEG F 4 (hourly) (TEMP) -#> 29 SNOW DEPTH, INCHES 18 (monthly) (SNOW DP) -#> 30 SNOW, WATER CONTENT, INCHES 3 (monthly) (SNOW WC) -#> 31 SNOW, WATER CONTENT(REVISED), INCHES 82 (monthly) (SNO ADJ) -#> 32 SOLAR RADIATION AVG, W/M^2 103 (hourly) (SLRR AV) -#> 33 SOLAR RADIATION MAX, W/M^2 105 (hourly) (SLRR MX) -#> 34 SOLAR RADIATION MIN, W/M^2 104 (hourly) (SLRR MN) -#> collection_method period_of_record -#> 1 COMPUTED 10/01/2002 to present -#> 2 COMPUTED 12/01/1996 to present -#> 3 COMPUTED 11/29/1989 to present -#> 4 COMPUTED 10/21/1989 to present -#> 5 COMPUTED 09/02/1999 to present -#> 6 COMPUTED 09/02/1999 to present -#> 7 COMPUTED 09/02/1999 to present -#> 8 SATELLITE 09/14/2016 to present -#> 9 SATELLITE 09/14/2016 to present -#> 10 SATELLITE 09/14/2016 to present -#> 11 SATELLITE 09/14/2016 to present -#> 12 SATELLITE 09/14/2016 to present -#> 13 SATELLITE 09/14/2016 to present -#> 14 SATELLITE 09/14/2016 to present -#> 15 SATELLITE 09/14/2016 to present -#> 16 SATELLITE 09/14/2016 to present -#> 17 SATELLITE 09/14/2016 to present -#> 18 SATELLITE 09/14/2016 to present -#> 19 SATELLITE 09/14/2016 to present -#> 20 SATELLITE 09/14/2016 to present -#> 21 SATELLITE 09/14/2016 to present -#> 22 SATELLITE 09/14/2016 to present -#> 23 SATELLITE 09/14/2016 to present -#> 24 SATELLITE 09/14/2016 to present -#> 25 SATELLITE 01/01/1995 to present -#> 26 SATELLITE 10/14/1989 to present -#> 27 SATELLITE 10/14/1989 to present -#> 28 SATELLITE 10/13/1989 to present -#> 29 MANUAL ENTRY 05/01/1952 to present -#> 30 MANUAL ENTRY 05/01/1952 to present -#> 31 MANUAL ENTRY 05/01/1952 to present -#> 32 SATELLITE 10/10/2012 to 09/14/2016 -#> 33 SATELLITE 10/10/2012 to 09/14/2016 -#> 34 SATELLITE 10/10/2012 to 09/14/2016 -#> -#> $comments -#> date -#> 1 04/27/2020 -#> 2 12/31/2016 -#> 3 07/23/2014 -#> comment -#> 1 Latitude and longitude updated from information provided by DFM-Statewide Monitoring Network Section. Datum WGS-84 -#> 2 Soil Tmp1, Soil Mois1 @ 16cm , Soil Tmp2, Soil Mois2 @ 31cm, Soil Tmp3, Soil Mois3 @ 62cm -#> 3 Latitude and longitude updated based on information from Hydrology Branch field technicians. -#>
- -# } - -
+
-
- +
- - + + diff --git a/docs/reference/CDECquery.html b/docs/reference/CDECquery.html index ab9f922d..aee14f39 100644 --- a/docs/reference/CDECquery.html +++ b/docs/reference/CDECquery.html @@ -1,67 +1,12 @@ - - - - - - - -Easy Access to the CDEC API — CDECquery • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Easy Access to the CDEC API — CDECquery • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,210 +52,92 @@

Easy Access to the CDEC API

A (relatively) simple interface to the CDEC website.

-
CDECquery(id, sensor, interval = "D", start, end)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
id

station ID (e.g. 'spw'), single value or vector of station IDs, see details

sensor

the sensor ID, single value or vector of sensor numbers, see details

interval

character, 'D' for daily, 'H' for hourly, 'M' for monthly, 'E' for event: see Details.

start

starting date, in the format 'YYYY-MM-DD'

end

ending date, in the format 'YYYY-MM-DD'

- -

Value

- -

A data.frame object with the following fields: datetime, year, month, value.

-

Details

+
+
CDECquery(id, sensor, interval = "D", start, end)
+
-

Sensors that report data on an interval other than monthly ('M'), daily ('D'), or hourly ('H') can be queried with an event interval ('E'). Soil moisture and temperature sensors are an example of this type of reporting. See examples below.

-
-
1.

Station IDs can be found here: http://cdec.water.ca.gov/staInfo.html

-
2a.

Sensor IDs can be found using this URL: http://cdec.water.ca.gov/dynamicapp/staMeta?station_id=, followed by the station ID.

-
2b.

Sensor details can be accessed using CDEC_StationInfo with the station ID.

-
3.

Resevoir capacities can be found here: http://cdec.water.ca.gov/misc/resinfo.html

-
4.

A new interactive map of CDEC stations can be found here: http://cdec.water.ca.gov

+
+

Arguments

+
id
+

station ID (e.g. 'spw'), single value or vector of station IDs, see details

-
-

References

+
sensor
+

the sensor ID, single value or vector of sensor numbers, see details

-

http://cdec.water.ca.gov/queryCSV.html

-

See also

- -

Author

+
interval
+

character, 'D' for daily, 'H' for hourly, 'M' for monthly, 'E' for event: see Details.

-

D.E. Beaudette

-

Examples

-
-# \donttest{ +
start
+

starting date, in the format 'YYYY-MM-DD'

-if(requireNamespace("curl") & -curl::has_internet() & - require(latticeExtra) & - require(plyr) & - require(e1071)) { - - library(RColorBrewer) - - # get daily reservoir storage (ac. ft) from - # Pinecrest, New Melones and Lyons reservoirs - pinecrest <- CDECquery(id='swb', sensor=15, interval='D', - start='2012-09-01', end='2015-01-01') - - new.melones <- CDECquery(id='nml', sensor=15, interval='D', - start='2012-09-01', end='2015-01-01') - - lyons <- CDECquery(id='lys', sensor=15, interval='D', - start='2012-09-01', end='2015-01-01') - - # compute storage capacity - pinecrest$capacity <- pinecrest$value / 18312 * 100 - new.melones$capacity <- new.melones$value / 2400000 * 100 - lyons$capacity <- lyons$value / 6228 * 100 - - # combine - g <- make.groups(new.melones, lyons, pinecrest) - - # resonable date scale - r <- range(g$datetime) - s.r <- seq(from=r[1], to=r[2], by='1 month') - - # better colors - tps <- list(superpose.line=list(lwd=2, col=brewer.pal(n=3, name='Set1'))) - - # plot - xyplot(capacity ~ datetime, groups=which, data=g, type='l', - xlab='', ylab='Capacity (%)', ylim=c(-5, 105), - scales=list(x=list(at=s.r, labels=format(s.r, "%b\n%Y"))), - auto.key=list(columns=3, lines=TRUE, points=FALSE), - par.settings=tps, - panel=function(...) { - panel.abline(h=seq(0, 100, by=10), col='grey') - panel.abline(v=s.r, col='grey') - panel.xyplot(...) - }) - - - ## - # New Melones monthly data, retrieve as far back in time as possible - new.melones.monthly <- CDECquery(id='nml', sensor=15, interval='M', - start='1900-01-01', end='2015-01-01') - - # convert to pct. capacity - new.melones.monthly$capacity <- new.melones.monthly$value / 2400000 * 100 - - - # make a nice color ramp function - cols <- colorRampPalette(brewer.pal(9, 'Spectral'), - space='Lab', interpolate='spline') - - # plot, each pixel is colored by the total precip by year/month - levelplot(capacity ~ year * month, data=new.melones.monthly, col.regions=cols, xlab='', - ylab='', scales=list(x=list(tick.number=20)), main='New Melones Capacity (%)') - - - ## - # get daily precip totals from Stan Powerhouse - x <- CDECquery(id='spw', sensor=45, interval='D', start='1900-01-01', end='2019-01-01') - - # compute total precip by year/month - a <- ddply(x, c('year', 'month'), summarize, s=sum(value, na.rm=TRUE)) - - # convert monthly precipitation values into Z-scores by month - a.scaled <- ddply(a, 'month', summarize, year=year, scaled.ppt=scale(s)) - - # make a nice color ramp function, scaled by the skewness of the underlying distribution - cols <- colorRampPalette( - brewer.pal(9, 'Spectral'), - space='Lab', interpolate='spline', bias=skewness(a.scaled$scaled.ppt, na.rm=TRUE)) - - # plot, each pixel is colored by the total precip by year/month - levelplot(scaled.ppt ~ year * month, data=a.scaled, col.regions=cols, xlab='', - ylab='', scales=list(x=list(tick.number=10)), - main='Monthly Total Precipitation (as z-score) SPW') - - - ## - # get pre-aggregated monthly data from Sonora RS - x <- CDECquery(id='sor', sensor=2, interval='M', start='1900-01-01', end='2019-01-01') - - # make a nice color ramp function, scaled by the skewness of the underlying distribution - cols <- colorRampPalette(brewer.pal(9, 'Spectral'), space='Lab', - interpolate='spline', bias=skewness(x$value, na.rm=TRUE)) - - # plot - levelplot(value ~ year * month, data=x, col.regions=cols, xlab='', - ylab='', scales=list(x=list(tick.number=20)), - main='Monthly Total Precipitation (inches) SOR') - - - ### query an 'event' type sensor - # Bryte test site (BYT) - # single request: air temperature and soil temperature at depth 1 (25cm) - # measurement interval is 20 minutes - x <- CDECquery('BYT', c(4, 194), 'E', '2016-01-01', '2017-01-01') - - # data are in long format, check number of records for each sensor - table(x$sensor_type) - - # plot grouped data - xyplot(value ~ datetime, groups=sensor_type, data=x, type=c('g', 'l'), - auto.key=list(columns=2, points=FALSE, lines=TRUE)) + +
end
+

ending date, in the format 'YYYY-MM-DD'

+ +
+
+

Value

- } -
#> Loading required package: latticeExtra
#> Warning: package 'latticeExtra' was built under R version 4.0.3
#> Loading required package: lattice
#> Loading required package: plyr
#> Warning: package 'plyr' was built under R version 4.0.3
#> -#> Attaching package: 'plyr'
#> The following objects are masked from 'package:aqp': -#> -#> mutate, summarize
#> Loading required package: e1071
#> Warning: package 'e1071' was built under R version 4.0.5
#> Warning: package 'RColorBrewer' was built under R version 4.0.3
-# } +

A data.frame object with the following fields: datetime, year, month, value.

+
+
+

Details

+

Sensors that report data on an interval other than monthly ('M'), daily ('D'), or hourly ('H') can be queried with an event interval ('E'). Soil moisture and temperature sensors are an example of this type of reporting. See examples below.

+
1.
+

Station IDs can be found here: http://cdec.water.ca.gov/staInfo.html

+ +
2a.
+

Sensor IDs can be found using this URL: http://cdec.water.ca.gov/dynamicapp/staMeta?station_id=, followed by the station ID.

+ +
2b.
+

Sensor details can be accessed using CDEC_StationInfo with the station ID.

+
3.
+

Reservoir capacities can be found here: http://cdec.water.ca.gov/misc/resinfo.html

+ +
4.
+

A new interactive map of CDEC stations can be found here: http://cdec.water.ca.gov

+ + +
+ + +
+

Author

+

D.E. Beaudette

+
-
+
- - - + + diff --git a/docs/reference/CDECsnowQuery.html b/docs/reference/CDECsnowQuery.html index ef5e3ffd..6e810b53 100644 --- a/docs/reference/CDECsnowQuery.html +++ b/docs/reference/CDECsnowQuery.html @@ -1,67 +1,12 @@ - - - - - - - -Get snow survey data (California only) from the CDEC website. — CDECsnowQuery • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Get snow survey data (California only) from the CDEC website. — CDECsnowQuery • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,81 +52,68 @@

Get snow survey data (California only) from the CDEC website.

Get snow survey data (California only) from the CDEC website.

-
CDECsnowQuery(course, start_yr, end_yr)
- -

Arguments

- - - - - - - - - - - - - - -
course

integer, course number (e.g. 129)

start_yr

integer, the starting year (e.g. 2010)

end_yr

integer, the ending year (e.g. 2013)

- -

Details

- -

This function downloads data from the CDEC website, therefore an internet connection is required. The `SWE` column contains adjusted SWE if available (`Adjusted` column), otherwise the reported SWE is used (`Water` column).

-

Value

+
+
CDECsnowQuery(course, start_yr, end_yr)
+
-

a data.frame object, see examples

-

References

+
+

Arguments

+
course
+

integer, course number (e.g. 129)

-

http://cdec.water.ca.gov/cgi-progs/snowQuery

-

Author

-

D.E. Beaudette

-

Note

+
start_yr
+

integer, the starting year (e.g. 2010)

-

Snow course locations, ID numbers, and other information can be found here: http://cdec.water.ca.gov/misc/SnowCourses.html

-

Examples

-
# \donttest{ +
end_yr
+

integer, the ending year (e.g. 2013)

-if(requireNamespace("curl") & - curl::has_internet() - ) { - - # get data for course numbe 129 - x <- CDECsnowQuery(course=129, start_yr=2010, end_yr=2011) - -} +
+
+

Value

+ +

a data.frame object, see examples

+
+
+

Details

+

This function downloads data from the CDEC website, therefore an internet connection is required. The SWE column contains adjusted SWE if available (Adjusted column), otherwise the reported SWE is used (Water column). See the tutorial for examples.

+
+
+

Note

+

Snow course locations, ID numbers, and other information can be found here: http://cdec.water.ca.gov/misc/SnowCourses.html

+
+ +
+

Author

+

D.E. Beaudette

+
-# } -
+
- - - + + diff --git a/docs/reference/FFD.html b/docs/reference/FFD.html index e71e9389..785f4075 100644 --- a/docs/reference/FFD.html +++ b/docs/reference/FFD.html @@ -1,67 +1,12 @@ - - - - - - - -Frost-Free Day Evaluation — FFD • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Frost-Free Day Evaluation — FFD • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,78 +52,104 @@

Frost-Free Day Evaluation

Evaluation frost-free days and related metrics from daily climate records.

-
FFD(d, returnDailyPr = TRUE, minDays = 165, ...)
-FFDplot(s, sub.title = NULL)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
d

data.frame with columns 'datetime' 'year', and 'value'; 'value' being daily minimum temperature, see details

returnDailyPr

optionally return list with daily summaries

minDays

min number of days / spring|fall required for a reasonable estimate of FFD

...

further arguments passed to frostFreePeriod

s

object returned by FFD

sub.title

override default subtitle

- -

Details

- -

The default frostTemp=32 argument to frostFreePeriod is suitable for use with minimum daily temperatures in degrees Fahrenheit. Use frostTemp=0 for temperatures in degrees Celsius.

-

FFD tutorial

-

Value

- -

a list with the following elements:

-
summary

FFD summary statistics as a data.frame

-
fm

frost matrix

-
Pr.frost

Pr(frost|day): daily probability of frost

- -

Author

+
+
FFD(
+  d,
+  returnDailyPr = TRUE,
+  minDays = 165,
+  frostTemp = 32,
+  endSpringDOY = 182,
+  startFallDOY = 213
+)
+
+ +
+

Arguments

+
d
+

data.frame with columns 'datetime' 'year', and 'value'; 'value' being daily minimum temperature, see details

+ + +
returnDailyPr
+

optionally return list with daily summaries

+ + +
minDays
+

min number of days of non-NA data in spring | fall, required for a reasonable estimate of FFD

+ +
frostTemp
+

critical temperature that defines "frost" (same units as d$value)

+ + +
endSpringDOY
+

day of year that marks end of "spring" (typically Jan 1 -- June 30)

+ + +
startFallDOY
+

day of year that marks start of "fall" (typically Aug 1 -- Dec 31)

+ +
+
+

Value

+ + +

a data.frame when a returnDailyPr=FALSE, otherwise a list with the following elements:

  • summary: FFD summary statistics as a data.frame

  • +
  • fm: frost matrix

  • +
  • Pr.frost: Pr(frost|day): daily probability of frost

  • +
+
+

Details

+

The default frostTemp=32 is suitable for use with minimum daily temperatures in degrees Fahrenheit. Use frostTemp = 0 for temperatures in degrees Celsius.

+

FFD tutorial

+
+
+

Author

D.E. Beaudette

+
+
+

Examples

+

+# 11 years of data from highland meadows
+data('HHM', package = 'sharpshootR')
+x.ffd <- FFD(HHM, returnDailyPr = FALSE, frostTemp = 32)
+
+str(x.ffd)
+#> 'data.frame':	1 obs. of  10 variables:
+#>  $ ffd.50   : num 80
+#>  $ ffd.80   : num 70
+#>  $ ffd.90   : num 60
+#>  $ spring.50: num 165
+#>  $ spring.80: num 168
+#>  $ spring.90: num 169
+#>  $ fall.50  : num 245
+#>  $ fall.80  : num 238
+#>  $ fall.90  : num 228
+#>  $ n.yrs    : num 6
+
+
+
+
- - - + + diff --git a/docs/reference/HHM.html b/docs/reference/HHM.html index d4332330..37e306a6 100644 --- a/docs/reference/HHM.html +++ b/docs/reference/HHM.html @@ -1,67 +1,12 @@ - - - - - - - -Highland Meadows — HHM • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Highland Meadows — HHM • sharpshootR - - - - + + -
-
- -
- -
+
-
data("HHM")
+
+
data("HHM")
+
+
+

Format

+

A data frame with 3469 observations on the following 12 variables.

station_id
+

a character vector

-

Format

+
dur_code
+

a character vector

-

A data frame with 3469 observations on the following 12 variables.

-
station_id

a character vector

-
dur_code

a character vector

-
sensor_num

a numeric vector

-
sensor_type

a character vector

-
value

a numeric vector

-
flag

a character vector

-
units

a character vector

-
datetime

a POSIXct

-
year

a numeric vector

-
month

a factor with levels January February March April May June July August September October November December

-
water_year

a numeric vector

-
water_day

a numeric vector

- -
+
sensor_num
+

a numeric vector

+ +
sensor_type
+

a character vector

+ +
value
+

a numeric vector

+
flag
+

a character vector

+ +
units
+

a character vector

+ +
datetime
+

a POSIXct

+ +
year
+

a numeric vector

+ +
month
+

a factor with levels January February March April May June July August September October November December

+ +
water_year
+

a numeric vector

+ +
water_day
+

a numeric vector

+ + +
+
-
- - + + diff --git a/docs/reference/HenryTimeLine.html b/docs/reference/HenryTimeLine.html index e1a0964a..adefbcfa 100644 --- a/docs/reference/HenryTimeLine.html +++ b/docs/reference/HenryTimeLine.html @@ -1,67 +1,12 @@ - - - - - - - -Sensor Data Timeline from Henry Mount Soil and Water DB — HenryTimeLine • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Sensor Data Timeline from Henry Mount Soil and Water DB — HenryTimeLine • sharpshootR - - + + - - -
-
- -
- -
+
-

This function generates a simple chart of start/end dates for a set of sensor data returned by soilDB::fetchHenry.

+

This function generates a simple chart of start/end dates for non-NA sensor data returned by soilDB::fetchHenry(). Data are organized according to sensor name + sensor depth.

-
HenryTimeLine(sensor_data, ...)
+
+
HenryTimeLine(sensor_data, ...)
+
-

Arguments

- - - - - - - - - - -
sensor_data

soiltemp, soilVWC, or related data returned by soilDB::fetchHenry()

...

additional arguments to latticeExtra::segplot

+
+

Arguments

+
sensor_data
+

soiltemp, soilVWC, or related data returned by soilDB::fetchHenry()

-

Value

-

a lattice graphics object

-

Note

+
...
+

additional arguments to latticeExtra::segplot

-

This function does not symbolize sections of missing data between the first and last record.

-

Author

+
+
+

Value

+ +

a lattice graphics object

+
+
+

Author

D.E. Beaudette

+
+
-
- - + + diff --git a/docs/reference/LL2PLSS.html b/docs/reference/LL2PLSS.html index 8200615e..b1cb4452 100644 --- a/docs/reference/LL2PLSS.html +++ b/docs/reference/LL2PLSS.html @@ -1,67 +1,12 @@ - - - - - - - -LL2PLSS — LL2PLSS • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -LL2PLSS — LL2PLSS • sharpshootR - - + + - - -
-
- -
- -
+
-

Uses lattitude and longitude coordinates to return the PLSS section geometry from the BLM PLSS web service.

+

Uses latitude and longitude coordinates to return the PLSS section geometry from the BLM PLSS web service.

-
LL2PLSS(x, y, returnlevel = "I")
- -

Arguments

- - - - - - - - - - - - - - -
x

longitude coordinates

y

lattitude coordinates

returnlevel

'S' for "Section" or 'I' for "Intersection" (subsections)

- -

Value

- -

list of of PLSS codes and coordinates.

-

Details

- -

This function takes xy coordinates and returns the PLSS section geometry to the quarter-quarter section. returnlevel options are defaulted to 'I' which returns smallest intersected sectional aliquot geometry, 'S' will return the section geometry of the coordinates. See https://gis.blm.gov/arcgis/rest/services/Cadastral/BLM_Natl_PLSS_CadNSDI/MapServer for details.

-

Note

+
+
LL2PLSS(x, y, returnlevel = c("I", "S"))
+
-

This function requires the following packages: httr, jsonlite, and sp.

-

See also

+
+

Arguments

+
x
+

longitude coordinates (WGS84)

+ + +
y
+

latitude coordinates (WGS84)

- -

Author

+
returnlevel
+

'S' for "Section" or 'I' for "Intersection" (subsections)

+ +
+
+

Value

+ + +

sf object with geometry and PLSS definition.

+
+
+

Details

+

This function accepts geographic coordinates and returns the PLSS fabric geometry to the quarter-quarter section. returnlevel defaults to 'I' which returns smallest intersected sectional aliquot geometry, 'S' will return the section geometry of the coordinates. See https://gis.blm.gov/arcgis/rest/services/Cadastral/BLM_Natl_PLSS_CadNSDI/MapServer for details.

+
+
+

Note

+

This function requires the following packages: httr, jsonlite, and sp.

+
+
+

See also

+ +
+
+

Author

D.E. Beaudette, Jay Skovlin, A.G. Brown

+
+
-
- - + + diff --git a/docs/reference/PCP_plot.html b/docs/reference/PCP_plot.html index 5df89104..8e28a5dc 100644 --- a/docs/reference/PCP_plot.html +++ b/docs/reference/PCP_plot.html @@ -1,67 +1,12 @@ - - - - - - - -Percentiles of Cumulative Precipitation — PCP_plot • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Percentiles of Cumulative Precipitation — PCP_plot • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,105 +52,88 @@

Percentiles of Cumulative Precipitation

Generate a plot representing percentiles of cumulative precipitation, given a historic record, and criteria for selecting a year of data for comparison.

-
PCP_plot(x, this.year, this.day = NULL, method = "exemplar", 
-q.color = "RoyalBlue", c.color = "firebrick", ...)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

result from CDECquery() for now, will need to generalize to other sources

this.year

a single water year, e.g. 2020

this.day

optional integer representing days since start of selected water year

method

'exemplar' or 'daily', currently 'exemplar' is the only method available

q.color

color of percentiles cumulative precipitation

c.color

color of selected year

...

addtional arguments to plot()

- -

Details

- -

This is very much a work in progress. Further examples at https://ncss-tech.github.io/AQP/sharpshootR/CDEC.html, and https://ncss-tech.github.io/AQP/sharpshootR/cumulative-PPT.html

-

Value

- -

Currently nothing is returned.

-

Author

+
+
PCP_plot(
+  x,
+  this.year,
+  this.day = NULL,
+  method = "exemplar",
+  q.color = "RoyalBlue",
+  c.color = "firebrick",
+  ...
+)
+
-

D.E. Beaudette

-

See also

+
+

Arguments

+
x
+

result from CDECquery for now, will need to generalize to other sources

- -

Examples

-
# \donttest{ +
this.year
+

a single water year, e.g. 2020

+ + +
this.day
+

optional integer representing days since start of selected water year

+ + +
method
+

'exemplar' or 'daily', currently 'exemplar' is the only method available

+ + +
q.color
+

color of percentiles cumulative precipitation

+ + +
c.color
+

color of selected year

+ + +
...
+

additional arguments to plot

+ +
+
+

Value

+ + +

nothing, this function is called to create graphical output

+
+
+

Details

+

This is very much a work in progress. Further examples at https://ncss-tech.github.io/AQP/sharpshootR/CDEC.html, and https://ncss-tech.github.io/AQP/sharpshootR/cumulative-PPT.html.

+
+
+

See also

+ +
+
+

Author

+

D.E. Beaudette

+
-if(requireNamespace("curl") & - curl::has_internet() - ) { - - s <- 'SPW' -# get metadata -s.info <- CDEC_StationInfo(s) -# format title for cumulative PPT -title.text <- sprintf("%s [%s]", s.info$site.meta$Name, s) - -# get data -x <- CDECquery(id=s, sensor=45, interval='D', start='2000-01-01', end='2030-01-01') - -## NOTE: requires sharpshootR >= 1.6.1 -# plot -par(mar=c(4.5, 4.5, 2.5, 1.5)) -PCP_plot(x[1:(nrow(x)-60), ], ylab='Cumulative PPT (inches)', main=title.text, this.year = 2020) - -} -
-# } -
+
- - - + + diff --git a/docs/reference/PLSS2LL.html b/docs/reference/PLSS2LL.html index f24ff00b..d862aabf 100644 --- a/docs/reference/PLSS2LL.html +++ b/docs/reference/PLSS2LL.html @@ -1,67 +1,12 @@ - - - - - - - -PLSS2LL — PLSS2LL • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -PLSS2LL — PLSS2LL • sharpshootR + + - - - - -
-
- -
- -
+
-

Fetch latitude and longitude centroid coordinates for coded PLSS information from the BLM PLSS web service.

+

Fetch latitude and longitude (centroid) coordinates for coded PLSS information from the BLM PLSS web service.

-
PLSS2LL(p, plssid = "plssid")
- -

Arguments

- - - - - - - - - - -
p

data.frame with chunks of PLSS coordinates

plssid

Column name containing PLSS ID (default: "plssid")

+
+
PLSS2LL(p, plssid = "plssid")
+
-

Value

+
+

Arguments

+
p
+

data.frame with chunks of PLSS definition

-

A data.frame of PLSS codes and coordinates.

-

Note

-

This function expects that the dataframe will have a 'plssid' column generated by the formatPLSS function. Requires the following packages: httr, and jsonlite.

-

See also

+
plssid
+

column name containing PLSS ID

- -

Author

+
+
+

Value

+ +

A data.frame of PLSS codes and coordinates.

+
+
+

Note

+

This function expects that the dataframe will have a 'plssid' column generated by the formatPLSS function. Requires the following packages: httr, and jsonlite.

+
+
+

See also

+ +
+
+

Author

D.E. Beaudette, Jay Skovlin, A.G. Brown

+
+
-
- - + + diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png index 83bfeedd..6a62b8bc 100644 Binary files a/docs/reference/Rplot001.png and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png index 5b25e1f8..3a4624f9 100644 Binary files a/docs/reference/Rplot002.png and b/docs/reference/Rplot002.png differ diff --git a/docs/reference/Rplot003.png b/docs/reference/Rplot003.png index ce05cd40..523d196b 100644 Binary files a/docs/reference/Rplot003.png and b/docs/reference/Rplot003.png differ diff --git a/docs/reference/Rplot004.png b/docs/reference/Rplot004.png index 6459b5fd..d001d834 100644 Binary files a/docs/reference/Rplot004.png and b/docs/reference/Rplot004.png differ diff --git a/docs/reference/Rplot005.png b/docs/reference/Rplot005.png index f3c5aa6d..f12caaf5 100644 Binary files a/docs/reference/Rplot005.png and b/docs/reference/Rplot005.png differ diff --git a/docs/reference/Rplot006.png b/docs/reference/Rplot006.png index 3e7dab6c..84437750 100644 Binary files a/docs/reference/Rplot006.png and b/docs/reference/Rplot006.png differ diff --git a/docs/reference/SoilTaxonomyDendrogram-1.png b/docs/reference/SoilTaxonomyDendrogram-1.png index 5e7a7790..1cd83547 100644 Binary files a/docs/reference/SoilTaxonomyDendrogram-1.png and b/docs/reference/SoilTaxonomyDendrogram-1.png differ diff --git a/docs/reference/SoilTaxonomyDendrogram-2.png b/docs/reference/SoilTaxonomyDendrogram-2.png index 5e7a7790..6f38e48d 100644 Binary files a/docs/reference/SoilTaxonomyDendrogram-2.png and b/docs/reference/SoilTaxonomyDendrogram-2.png differ diff --git a/docs/reference/SoilTaxonomyDendrogram.html b/docs/reference/SoilTaxonomyDendrogram.html index 51e44dc1..15090caf 100644 --- a/docs/reference/SoilTaxonomyDendrogram.html +++ b/docs/reference/SoilTaxonomyDendrogram.html @@ -1,67 +1,12 @@ - - - - - - - -Soil Taxonomy Dendrogram — SoilTaxonomyDendrogram • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Soil Taxonomy Dendrogram — SoilTaxonomyDendrogram • sharpshootR - - + + - - -
-
- -
- -
+
-

Plot a dendrogram based on the first 4 levels of Soil Taxonomy, with soil profiles hanging below. A dissimilarity matrix is computed using Gower's distance metric for nominal-scale variables, based on order, sub order, great group, and subgroup level taxa. See the Details and Examples sections below for more information.

+

Plot a dendrogram based on the first 4 levels of Soil Taxonomy, with soil profiles hanging below. A dissimilarity matrix is computed using Gower's distance metric for nominal (KST.order = FALSE) or ordinal (KST.order = TRUE) scale variables, based on soil order, suborder, greatgroup, and subgroup taxa.

-
SoilTaxonomyDendrogram(
-  spc,
-  name = "hzname",
-  name.style = "right-center",
-  rotationOrder = NULL,
-  max.depth = 150,
-  n.depth.ticks = 6,
-  scaling.factor = 0.015,
-  cex.names = 0.75,
-  cex.id = 0.75,
-  axis.line.offset = -4,
-  width = 0.1,
-  y.offset = 0.5,
-  shrink = FALSE,
-  font.id = 2,
-  cex.taxon.labels = 0.66,
-  dend.color = par("fg"),
-  dend.width = 1,
-  ...
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
spc

a SoilProfileCollection object, typically returned by soilDB::fetchOSD

name

column name containing horizon names

name.style

passed to aqp::plotSPC (default: "right-center")

rotationOrder

numeric vector with desired ordering of leaves in the dendrogram from left to right, or character vector matching profile IDs

max.depth

depth at which profiles are truncated for plotting

n.depth.ticks

suggested number of ticks on the depth axis

scaling.factor

scaling factor used to convert depth units into plotting units

cex.names

character scaling for horizon names

cex.id

character scaling for profile IDs

axis.line.offset

horizontal offset for depth axis

width

width of profiles

y.offset

vertical offset between dendrogram and profiles

shrink

logical, should long horizon names be shrunk by 80% ?

font.id

font style applied to profile id, default is 2 (bold)

cex.taxon.labels

character scaling for taxonomic information

dend.color

dendrogram line color

dend.width

dendrogram line width

...

additional arguments to aqp::plotSPC

- -

Value

- -

An invisibly-returned list containing:

    -
  • dist: pair-wise dissimilarity matrix

  • -
  • order: final ordering of hclust leaves

  • -
- -

Details

- -

This function looks for specific site-level attributes named: soilorder, suborder, greatgroup, and subgroup.

-

The rotationOrder argument uses (requires) the dendextend::rotate() function to re-order leaves within the hclust representation of the ST hierarchy. Perfect sorting is not always possible.

-

Author

+
+
SoilTaxonomyDendrogram(
+  spc,
+  KST.order = TRUE,
+  rotationOrder = NULL,
+  level = c(soilorder = "soilorder", suborder = "suborder", greatgroup = "greatgroup",
+    subgroup = "subgroup"),
+  cluster.method = c("divisive", "agglomerative"),
+  cluster.args = list(),
+  name = "hzname",
+  name.style = "center-center",
+  id.style = "side",
+  max.depth = max(spc),
+  n.depth.ticks = 6,
+  scaling.factor = 0.015,
+  cex.names = 0.75,
+  cex.id = 0.75,
+  axis.line.offset = -4,
+  width = 0.1,
+  y.offset = 0.5,
+  shrink = FALSE,
+  font.id = 2,
+  cex.taxon.labels = 0.66,
+  dend.color = par("fg"),
+  dend.width = 1,
+  ...
+)
+
-

D.E. Beaudette

+
+

Arguments

+
spc
+

a SoilProfileCollection object, typically returned by soilDB::fetchOSD

-

Examples

-
-# \donttest{ -if(requireNamespace("curl") & - curl::has_internet() & - require(aqp) & - require(soilDB) -) { - - - - # soils of interest - s.list <- c('musick', 'cecil', 'drummer', 'amador', 'pentz', 'reiff', - 'san joaquin','montpellier','grangeville','pollasky','ramona') - - # fetch and convert data into an SPC - h <- fetchOSD(s.list) - - # plot dendrogram + profiles - SoilTaxonomyDendrogram(h) - - # again, this time save the pair-wise dissimilarity matrix - # note that there isn't a lot of discrimination between soils - (d <- SoilTaxonomyDendrogram(h)) - - - # a different set - soils <- c('cecil', 'altavista', 'lloyd', 'wickham', 'wilkes', - 'chewacla', 'congaree') - - # get morphology + extended summaries for sorting of dendrogram - s <- fetchOSD(soils, extended = TRUE) - - # get summary and ignore the figure - res <- vizHillslopePosition(s$hillpos) - - # compare default sorting to soils sorting according to catenary, e.g. - # hillslope position - par(mar=c(0,0,1,1), mfrow=c(2,1)) - - SoilTaxonomyDendrogram(s$SPC, width=0.25) - mtext('default sorting', side = 2, line=-1, font=3, cex=1.25) - - SoilTaxonomyDendrogram(s$SPC, rotationOrder = res$order, width=0.25) - mtext('approx. catenary sorting', side = 2, line=-1, font=3, cex=1.25) - - -# classic chronosequence from the San Joaquin Valley, CA -library(aqp) -library(soilDB) -library(sharpshootR) - -s <- c('tujunga', 'hanford', 'greenfield', 'snelling', 'san joaquin') -osds <- fetchOSD(s) - -idx <- match(toupper(s), profile_id(osds)) - -# encode horizon boundarydistinctness via vertical offset -osds$hd <- hzDistinctnessCodeToOffset( - osds$distinctness, - codes=c('very abrupt', 'abrupt', 'clear', 'gradual', 'diffuse') -) - -# encode horizon boundary topography via vertical offset -osds$hzto <- hzTopographyCodeToOffset( - osds$topography, - codes = c('smooth', 'wavy', 'irregular', 'broken') -) - -# also encode horizon boundary topography las line type -osds$hzto.lty <- hzTopographyCodeToLineType( - osds$topography, - codes = c('smooth', 'wavy', 'irregular', 'broken') -) - -# label data source, used later -site(osds)$source <- 'OSD' - -# concise representation of hz bnd distinctness and topography -# similar to field notes -osds$bnd.code <- sprintf( - "%s%s", - substr(osds$distinctness, 1, 1), - substr(osds$topography, 1, 1) -) - -# remove NA -osds$bnd.code <- gsub('NANA', '', osds$bnd.code) - -par(mar = c(0, 0, 0, 1), bg = 'black', fg = 'white') - -plotSPC( -osds, -plot.order = idx, -width = 0.3, -name.style = 'center-center', -cex.names = 0.66, -plot.depth.axis = FALSE, -hz.depths = TRUE, -shrink = TRUE, -hz.distinctness.offset = 'hd', -hz.topography.offset = 'hzto', -hz.boundary.lty = 'hzto.lty' -) - -legend( -'bottomright', -horiz = TRUE, -legend = c('Smooth', 'Wavy', 'Irregular', 'Broken'), -lty = 1:4, -inset = 0.05, -bty = 'n', -cex = 0.85 -) - -# note that `rotationOrder` uses the ordering of series names (uppercase to match profile IDs) -# to re-order the terminal branches of the dendrogram -SoilTaxonomyDendrogram( -osds, -rotationOrder = toupper(s), -cex.taxon.labels = 0.85, -width = 0.3, -name.style = 'center-center', -cex.names = 0.66, -plot.depth.axis = FALSE, -hz.depths = TRUE, -shrink = TRUE, -hz.distinctness.offset = 'hd', -hz.topography.offset = 'hzto', -hz.boundary.lty = 'hzto.lty' -) - -legend( -'bottomright', -horiz = TRUE, -legend = c('Smooth', 'Wavy', 'Irregular', 'Broken'), -lty = 1:4, -inset = 0.05, -bty = 'n', -cex = 0.85 -) - -} -
#> Registered S3 method overwritten by 'dendextend': -#> method from -#> rev.hclust vegan
-# } +
KST.order
+

logical, encode / cluster taxa via ordinal factors, based on ordering within Keys to Soil Taxonomy

+ + +
rotationOrder
+

character vector of profile IDs with desired ordering of leaves in the dendrogram from left to right; exact ordering is not always possible

+ -
+
level
+

character. One or more site-level columns in spc. Default: "soilorder", "suborder", "greatgroup" and "subgroup"

+ + +
cluster.method
+

Either "divisive" (cluster::diana(); default) or "agglomerative" (cluster::agnes())

+ + +
cluster.args
+

Optional: additional arguments for cluster::diana() or cluster::agnes() cluster methods

+ + +
name
+

column name containing horizon names

+ + +
name.style
+

passed to aqp::plotSPC

+ + +
id.style
+

passed to aqp::plotSPC

+ + +
max.depth
+

depth at which profiles are truncated for plotting

+ + +
n.depth.ticks
+

suggested number of ticks on the depth axis

+ + +
scaling.factor
+

scaling factor used to convert depth units into plotting units

+ + +
cex.names
+

character scaling for horizon names

+ + +
cex.id
+

character scaling for profile IDs

+ + +
axis.line.offset
+

horizontal offset for depth axis

+ + +
width
+

width of profiles

+ + +
y.offset
+

vertical offset between dendrogram and profiles

+ + +
shrink
+

logical, should long horizon names be shrunk by 80% ?

+ + +
font.id
+

font style applied to profile id, default is 2 (bold)

+ + +
cex.taxon.labels
+

character scaling for taxonomic information

+ + +
dend.color
+

dendrogram line color

+ + +
dend.width
+

dendrogram line width

+ + +
...
+

additional arguments to aqp::plotSPC

+ +
+
+

Value

+ + +

An invisibly-returned list containing:

  • dist: pair-wise dissimilarity matrix

  • +
  • order: final ordering of hclust leaves

  • +
+
+

Details

+

This function looks for specific site-level attributes named: "soilorder", "suborder", "greatgroup", and "subgroup", or their NASIS physical column name analogues "taxorder", "taxsuborder", "taxgrtgroup", and "taxsubgrp". See https://github.com/ncss-tech/sharpshootR/blob/master/misc/soilTaxonomyDendrogram-examples.R for some examples.

+

The rotationOrder argument uses ape::rotateConstr() to reorder leaves within the hclust representation of the ST hierarchy. Perfect sorting is not always possible.

+
+
+

Author

+

D.E. Beaudette

+
+ +
+

Examples

+

+# built-in data, same as results from soilDB::fetchOSD()
+data("OSDexamples")
+
+# examples using first 8 profiles
+
+# KST-style ordering
+SoilTaxonomyDendrogram(
+  OSDexamples$SPC[1:8, ], width = 0.3, name.style = 'center-center',
+  KST.order = TRUE
+)
+
+
+# classic ordering, based on nominal scale variables (unordered factors)
+SoilTaxonomyDendrogram(
+  OSDexamples$SPC[1:8, ], width = 0.3, name.style = 'center-center',
+  KST.order = FALSE
+)
+
+
+
+
+
+
-
- - + + diff --git a/docs/reference/aggregateColorPlot-1.png b/docs/reference/aggregateColorPlot-1.png index 0a95ecb9..428a89c7 100644 Binary files a/docs/reference/aggregateColorPlot-1.png and b/docs/reference/aggregateColorPlot-1.png differ diff --git a/docs/reference/aggregateColorPlot.html b/docs/reference/aggregateColorPlot.html index bf2973f2..e324f1f6 100644 --- a/docs/reference/aggregateColorPlot.html +++ b/docs/reference/aggregateColorPlot.html @@ -1,67 +1,12 @@ - - - - - - - -Plot aggregate soil color data — aggregateColorPlot • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Plot aggregate soil color data — aggregateColorPlot • sharpshootR - - - - + + -
-
- -
- -
+
-

Generate a plot from summaries generated by aqp::aggregateColor().

+

Generate a plot from summaries generated by aqp::aggregateColor().

-
aggregateColorPlot(x, print.label=TRUE, label.font = 1, 
-label.cex = 0.65, buffer.pct = 0.02, print.n.hz=FALSE, 
-rect.border='black', horizontal.borders=FALSE, 
-horizontal.border.lwd=2, x.axis=TRUE, y.axis=TRUE,
-...)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

a list, results from aqp::aggregateColor()

print.label

print Munsell color labels inside of rectangles, when they fit

label.font

font specification for color labels

label.cex

font size for color lables

buffer.pct

extra space between labels and color rectangles

print.n.hz

optionally print the number of horizons

rect.border

color for rectangle border

horizontal.borders

optionally add horizontal borders between bands of color

horizontal.border.lwd

line width for horizontal borders

x.axis

logical: add a scale and label to x-axis?

y.axis

logical: add group labels to y-axis?

...

additional arguments passed to plot

- -

Details

- -

Tutorial at http://ncss-tech.github.io/AQP/sharpshootR/aggregate-soil-color.html.

-

Author

+
+
aggregateColorPlot(
+  x,
+  print.label = TRUE,
+  label.font = 1,
+  label.cex = 0.65,
+  label.orientation = c("v", "h"),
+  buffer.pct = 0.02,
+  print.n.hz = FALSE,
+  rect.border = "black",
+  horizontal.borders = FALSE,
+  horizontal.border.lwd = 2,
+  x.axis = TRUE,
+  y.axis = TRUE,
+  ...
+)
+
-

D.E. Beaudette

+
+

Arguments

+
x
+

a list, results from aqp::aggregateColor()

-

Examples

-
# \donttest{ -if(requireNamespace("curl") & - curl::has_internet() & - require(aqp) & - require(soilDB)) { - - data(loafercreek, package = 'soilDB') +
print.label
+

logical, print Munsell color labels inside of rectangles, only if they fit

-# generalize horizon names using REGEX rules -n <- c('Oi', 'A', 'BA','Bt1','Bt2','Bt3','Cr','R') -p <- c('O', '^A$|Ad|Ap|AB','BA$|Bw', -'Bt1$|^B$','^Bt$|^Bt2$','^Bt3|^Bt4|CBt$|BCt$|2Bt|2CB$|^C$','Cr','R') -loafercreek$genhz <- generalize.hz(loafercreek$hzname, n, p) -# remove non-matching generalized horizon names -loafercreek$genhz[loafercreek$genhz == 'not-used'] <- NA -loafercreek$genhz <- factor(loafercreek$genhz) +
label.font
+

font specification for color labels

-# aggregate color data, this function is from the `aqp` package -a <- aggregateColor(loafercreek, 'genhz') -# plot -par(mar=c(4,4,1,1)) -aggregateColorPlot(a, print.n.hz = TRUE) - -} -
#> Loading required package: aqp
#> This is aqp 1.30
#> -#> Attaching package: 'aqp'
#> The following object is masked from 'package:stats': -#> -#> filter
#> Loading required package: soilDB
+
label.cex
+

font size for color labels

+ + +
label.orientation
+

label orientation, v for vertical or h for horizontal

+ + +
buffer.pct
+

extra space between labels and color rectangles

+ + +
print.n.hz
+

optionally print the number of horizons below Munsell color labels

+ + +
rect.border
+

color for rectangle border

+ + +
horizontal.borders
+

optionally add horizontal borders between bands of color

+ + +
horizontal.border.lwd
+

line width for horizontal borders

-# } -
+
x.axis
+

logical, add a scale and label to x-axis?

+ + +
y.axis
+

logical, add group labels to y-axis?

+ + +
...
+

additional arguments passed to plot

+ +
+
+

Value

+ + +

nothing, function called for graphical output

+
+ +
+

Author

+

D.E. Beaudette

+
+ +
+

Examples

+

+# \donttest{
+
+if(require(aqp) &
+   require(soilDB)) {
+  
+  data(loafercreek, package = 'soilDB')
+  
+  # generalize horizon names using REGEX rules
+  n <- c('Oi', 'A', 'BA','Bt1','Bt2','Bt3','Cr','R')
+  p <- c('O', '^A$|Ad|Ap|AB','BA$|Bw', 
+         'Bt1$|^B$','^Bt$|^Bt2$','^Bt3|^Bt4|CBt$|BCt$|2Bt|2CB$|^C$','Cr','R')
+  loafercreek$genhz <- generalize.hz(loafercreek$hzname, n, p)
+  
+  # remove non-matching generalized horizon names
+  loafercreek$genhz[loafercreek$genhz == 'not-used'] <- NA
+  loafercreek$genhz <- factor(loafercreek$genhz)
+  
+  # aggregate color data, this function is from the `aqp` package
+  a <- aggregateColor(loafercreek, 'genhz')
+  
+  # plot
+  op <- par(no.readonly = TRUE)
+  
+  par(mar=c(4,4,1,1))
+  
+  # vertical labels, the default
+  aggregateColorPlot(a, print.n.hz = TRUE)
+  
+  # horizontal labels
+  aggregateColorPlot(a, print.n.hz = TRUE, label.orientation = 'h')
+  
+  par(op)
+  
+}
+#> Loading required package: aqp
+#> This is aqp 2.0
+#> Loading required package: soilDB
+
+
+
+# }
+
+
+
-
- - + + diff --git a/docs/reference/amador.html b/docs/reference/amador.html index db16782d..51a63546 100644 --- a/docs/reference/amador.html +++ b/docs/reference/amador.html @@ -1,67 +1,12 @@ - - - - - - - -SSURGO Data Associated with the Amador Soil Series — amador • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -SSURGO Data Associated with the Amador Soil Series — amador • sharpshootR - - - - + + -
-
- -
- -
+
-
data(amador)
- +
+
data(amador)
+
-

Format

+
+

Format

+

A subset of data taken from the "component" table of SSURGO

mukey
+

map unit key

-

A subset of data taken from the "component" table of SSURGO

-
mukey

map unit key

-
compname

component name

-
comppct_r

component percentage

- -
+
compname
+

component name

-

Source

+
comppct_r
+

component percentage

+ +
+
+

Source

USDA-NRCS SSURGO Database

+
+
-
- - + + diff --git a/docs/reference/aspect.plot-1.png b/docs/reference/aspect.plot-1.png index 51a547fd..9f5be733 100644 Binary files a/docs/reference/aspect.plot-1.png and b/docs/reference/aspect.plot-1.png differ diff --git a/docs/reference/aspect.plot.html b/docs/reference/aspect.plot.html index 6cb21f99..c2e470ed 100644 --- a/docs/reference/aspect.plot.html +++ b/docs/reference/aspect.plot.html @@ -1,67 +1,12 @@ - - - - - - - -Plot Aspect Data — aspect.plot • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Plot Aspect Data — aspect.plot • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,137 +52,163 @@

Plot Aspect Data

Plot a graphical summary of multiple aspect measurements on a circular diagram.

-
aspect.plot(p, q=c(0.05, 0.5, 0.95), p.bins = 60, p.bw = 30, stack=TRUE, 
-p.axis = seq(0, 350, by = 10), plot.title = NULL,
-line.col='RoyalBlue', line.lwd=1, line.lty=2, 
-arrow.col=line.col, arrow.lwd=1, arrow.lty=1,
-arrow.length=0.15,
-...)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
p

a vector of aspect angles in degrees, measured clock-wise from North

q

a vector of desired quantiles

p.bins

number of bins to use for circular histogram

p.bw

bandwidth used for circular density estimation

stack

TRUE/FALSE, should the individual points be stacked into p.bins number of bins and plotted

p.axis

a sequence of integers (degrees) describing the circular axis

plot.title

an informative title

line.col

density line color

line.lwd

density line width

line.lty

density line line style

arrow.col

arrow color

arrow.lwd

arrow line width

arrow.lty

arrow line style

arrow.length

arrow head length

...

further arguments passed to plot.circular

- -

Details

+
+
aspect.plot(
+  p,
+  q = c(0.05, 0.5, 0.95),
+  p.bins = 60,
+  p.bw = 30,
+  stack = TRUE,
+  p.axis = seq(0, 350, by = 10),
+  plot.title = NULL,
+  line.col = "RoyalBlue",
+  line.lwd = 1,
+  line.lty = 2,
+  arrow.col = line.col,
+  arrow.lwd = 1,
+  arrow.lty = 1,
+  arrow.length = 0.15,
+  ...
+)
+
-

Spread and central tendency are depicted with a combination of circular histogram and kernel density estimate. The circular mean, and relative confidence in that mean are depicted with an arrow: longer arrow lengths correspond to greater confidence in the mean.

-

Author

+
+

Arguments

+
p
+

a vector of aspect angles in degrees, measured clock-wise from North

-

D.E. Beaudette

-

Note

+
q
+

a vector of desired quantiles

+ + +
p.bins
+

number of bins to use for circular histogram

+ + +
p.bw
+

bandwidth used for circular density estimation

+ + +
stack
+

logical, should the individual points be stacked into p.bins number of bins and plotted

+ + +
p.axis
+

a sequence of integers (degrees) describing the circular axis

+ + +
plot.title
+

an informative title

+ + +
line.col
+

density line color

+ + +
line.lwd
+

density line width

+ + +
line.lty
+

density line line style

+ + +
arrow.col
+

arrow color

+ + +
arrow.lwd
+

arrow line width

+ + +
arrow.lty
+

arrow line style

+ + +
arrow.length
+

arrow head length

+ + +
...
+

further arguments passed to circular::plot.circular

+ +
+
+

Value

+ + +

invisibly returns circular stats

+
+
+

Details

+

Spread and central tendency are depicted with a combination of circular histogram and kernel density estimate. The circular mean, and relative confidence in that mean are depicted with an arrow: longer arrow lengths correspond to greater confidence in the mean.

+
+
+

Note

Manual adjustment of p.bw may be required in order to get an optimal circular density plot. This function requires the package circular, version 0.4-7 or later.

+
+
+

Author

+

D.E. Beaudette

+
-

Examples

-
# simulate some data -p.narrow <- runif(n=25, min=215, max=280) -p.wide <- runif(n=25, min=0, max=270) - -# set figure margins to 0, 2-column plot -par(mar=c(0,0,0,0), mfcol=c(1,2)) - -# plot -aspect.plot(p.narrow, p.bw=10, plot.title='Soil A', pch=21, col='black', bg='RoyalBlue') -
#> -#> Rayleigh Test of Uniformity -#> General Unimodal Alternative -#> -#> Test Statistic: 0.9431 -#> P-value: 0 -#>
aspect.plot(p.wide, p.bw=10, plot.title='Soil B', pch=21, col='black', bg='RoyalBlue') -
#> -#> Rayleigh Test of Uniformity -#> General Unimodal Alternative -#> -#> Test Statistic: 0.3636 -#> P-value: 0.035 -#>
+
+

Examples

+
# simulate some data
+p.narrow <- runif(n=25, min=215, max=280)
+p.wide <- runif(n=25, min=0, max=270)
+
+# set figure margins to 0, 2-column plot
+op <- par(no.readonly = TRUE)
+par(mar = c(0,0,0,0), mfcol = c(1,2))
+
+# plot, save circular stats 
+x <- aspect.plot(p.narrow, p.bw=10, plot.title='Soil A', pch=21, col='black', bg='RoyalBlue')
+y <- aspect.plot(p.wide, p.bw=10, plot.title='Soil B', pch=21, col='black', bg='RoyalBlue')
+
+
+# reset output device options
+par(op) 
+
+x
+#> Circular Data: 
+#> Type = angles 
+#> Units = degrees 
+#> Template = geographics 
+#> Modulo = 2pi 
+#> Zero = 1.570796 
+#> Rotation = clock 
+#>       5%      50%      95% 
+#> 274.1839 245.3117 217.7417 
+#> attr(,"uniformity")
+#> Rayleigh Uniformity             p Value 
+#>        9.521243e-01        7.135418e-10 
+
+
+
+
+
- - - + + diff --git a/docs/reference/colorMixtureVenn-1.png b/docs/reference/colorMixtureVenn-1.png index c5dbe496..a2ae61c3 100644 Binary files a/docs/reference/colorMixtureVenn-1.png and b/docs/reference/colorMixtureVenn-1.png differ diff --git a/docs/reference/colorMixtureVenn.html b/docs/reference/colorMixtureVenn.html index 93753359..00ae4269 100644 --- a/docs/reference/colorMixtureVenn.html +++ b/docs/reference/colorMixtureVenn.html @@ -1,67 +1,12 @@ - - - - - - - -Create a Venn Diagram of Simulated Color Mixtures — colorMixtureVenn • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Create a Venn Diagram of Simulated Color Mixtures — colorMixtureVenn • sharpshootR + + - - - - -
-
- -
- -
+
@@ -117,70 +52,99 @@

Create a Venn Diagram of Simulated Color Mixtures

Create a Venn Diagram of Simulated Color Mixtures

-
colorMixtureVenn(
-  chips,
-  mixingMethod = "spectra",
-  ellipse = FALSE,
-  labels = TRUE
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
chips

character vector of standard Munsell color notation (e.g. "10YR 3/4")

mixingMethod

approach used to simulate a mixture: see aqp::mixMunsell for details

ellipse

logical, use alternative ellipse-style (4 or 5 colors only)

labels

logical, print mixture labels

- - -

Examples

-
-if(requireNamespace("venn") & requireNamespace("gower")) { - -# "tan" / "dark red" / "dark brown" -chips <- c('10YR 8/1', '2.5YR 3/6', '10YR 2/2') -colorMixtureVenn(chips) - -} -
#> Loading required namespace: venn
#> Loading required namespace: gower
#> please use `mixingMethod = "reference"`
#> please use `mixingMethod = "reference"`
#> please use `mixingMethod = "reference"`
#> please use `mixingMethod = "reference"`
+
+
colorMixtureVenn(
+  chips,
+  w = rep(1, times = length(chips))/length(chips),
+  mixingMethod = "exact",
+  ellipse = FALSE,
+  labels = TRUE,
+  names = FALSE,
+  sncs = 0.85
+)
+
+ +
+

Arguments

+
chips
+

character vector of standard Munsell color notation (e.g. "10YR 3/4")

+ + +
w
+

vector of proportions, can sum to any number, must be same length as chips

+ + +
mixingMethod
+

approach used to simulate a mixture: see aqp::mixMunsell for details

+ + +
ellipse
+

logical, use alternative ellipse-style (4 or 5 colors only)

+ + +
labels
+

logical, print mixture labels

+ + +
names
+

logical, print names outside of the "sets"

+ + +
sncs
+

scaling factor for set names

+ +
+
+

Value

+ + +

nothing returned, function is called to create graphical output

+
+ +
+

Examples

+

+if(requireNamespace("venn") & requireNamespace("gower")) {
+
+chips <- c('10YR 8/1', '2.5YR 3/6', '10YR 2/2')
+names(chips) <- c("tan", "dark red", "dark brown")
+
+colorMixtureVenn(chips)
+colorMixtureVenn(chips, names = TRUE)
+
+colorMixtureVenn(chips, w = c(1, 1, 1), names = TRUE)
+colorMixtureVenn(chips, w = c(10, 5, 1), names = TRUE)
+
+}
+#> Loading required namespace: venn
+
+
+
+
+
+
+
+
- - - + + diff --git a/docs/reference/component.adj.matrix-1.png b/docs/reference/component.adj.matrix-1.png index 16c12e39..a6af4397 100644 Binary files a/docs/reference/component.adj.matrix-1.png and b/docs/reference/component.adj.matrix-1.png differ diff --git a/docs/reference/component.adj.matrix.html b/docs/reference/component.adj.matrix.html index 5730840c..640a5c09 100644 --- a/docs/reference/component.adj.matrix.html +++ b/docs/reference/component.adj.matrix.html @@ -1,67 +1,12 @@ - - - - - - - -Create an adjacency matrix from a data.frame of component data — component.adj.matrix • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Create an adjacency matrix from a data.frame of component data — component.adj.matrix • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,100 +52,111 @@

Create an adjacency matrix from a data.frame of component data

Create an adjacency matrix from SSURGO component data

-
component.adj.matrix(d, mu='mukey', co='compname', wt='comppct_r', 
-method='community.matrix', standardization='max', metric='jaccard',
-rm.orphans=TRUE, similarity=TRUE, return.comm.matrix=FALSE)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
d

a data.frame, typically of SSURGO data

mu

name of the column containing the map unit ID (typically 'mukey')

co

name of the column containing the component ID (typically 'compname')

wt

name of the column containing the component weight percent (typically 'comppct_r')

method

one of either: `community.matrix`, or `occurrence`; see details

standardization

community matrix standardization method, passed to decostand

metric

community matrix dissimilarity metric, passed to vegdist

rm.orphans

logical, should map units with a single component be ommitted? (typically yes)

similarity

logical, return a similarity matrix? (if FALSE, a distance matrix is returned)

return.comm.matrix

logical, return pseudo-community matrix? (if TRUE no adjacency matrix is created)

- -

Value

- -

a similatiy matrix / ajacency matrix suitable for use with igraph functions or anything else that can accomodate a _similarity_ matrix.

-

Author

+
+
component.adj.matrix(
+  d,
+  mu = "mukey",
+  co = "compname",
+  wt = "comppct_r",
+  method = c("community.matrix", "occurrence"),
+  standardization = "max",
+  metric = "jaccard",
+  rm.orphans = TRUE,
+  similarity = TRUE,
+  return.comm.matrix = FALSE
+)
+
-

D.E. Beaudette

-

Details

+
+

Arguments

+
d
+

data.frame, typically of SSURGO data

+ + +
mu
+

name of the column containing the map unit ID (typically 'mukey')

+ + +
co
+

name of the column containing the component ID (typically 'compname')

+ + +
wt
+

name of the column containing the component weight percent (typically 'comppct_r')

+ + +
method
+

one of either: community.matrix, or occurrence; see details

+ + +
standardization
+

community matrix standardization method, passed to vegan::decostand

-

Pending...

-

Examples

-
# load sample data set -data(amador) +
metric
+

community matrix dissimilarity metric, passed to vegan::vegdist

-# convert into adjacency matrix -m <- component.adj.matrix(amador) -# plot network diagram, with Amador soil highlighted -plotSoilRelationGraph(m, s='amador') -
+
rm.orphans
+

logical, should map units with a single component be omitted? (typically yes)

+ + +
similarity
+

logical, return a similarity matrix? (if FALSE, a distance matrix is returned)

+ + +
return.comm.matrix
+

logical, return pseudo-community matrix? (if TRUE no adjacency matrix is created)

+ +
+
+

Value

+ + +

a similarity matrix / adjacency matrix suitable for use with igraph functions or anything else that can accommodate a similarity matrix.

+
+
+

Author

+

D.E. Beaudette

+
+ +
+

Examples

+
if (requireNamespace("igraph")) {
+  # load sample data set
+  data(amador)
+
+  # convert into adjacency matrix
+  m <- component.adj.matrix(amador)
+
+  # plot network diagram, with Amador soil highlighted
+  plotSoilRelationGraph(m, s = 'amador')
+}
+#> Loading required namespace: igraph
+
+
+
+
- - - + + diff --git a/docs/reference/constantDensitySampling.html b/docs/reference/constantDensitySampling.html index 91dc93f5..2ed77a33 100644 --- a/docs/reference/constantDensitySampling.html +++ b/docs/reference/constantDensitySampling.html @@ -1,67 +1,12 @@ - - - - - - - -Constant Density Sampling — constantDensitySampling • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Constant Density Sampling — constantDensitySampling • sharpshootR - - - - + + -
-
- -
- -
+
-
constantDensitySampling(x, polygon.id='pID', parallel=FALSE, cores=NULL, 
-n.pts.per.ac=1, min.samples=5, sampling.type='regular', iterations=10)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

a SpatialPolygonsDataFrame object in a projected CRS with units of meters

polygon.id

name of attribute in x that contains a unique ID for each polygon

parallel

invoke parallel back-end

cores

number of CPU cores to use for parallel operation

n.pts.per.ac

requested sampling density in points per acre (results will be close)

min.samples

minimum requested number of samples per polygon

sampling.type

sampling type, see spsample

iterations

number of tries that spsample will attempt

- -

Value

+
+
constantDensitySampling(x, polygon.id='pID', parallel=FALSE, cores=NULL, 
+n.pts.per.ac=1, min.samples=5, sampling.type='regular')
+
-

a SpatialPointsDataFrame object

-

Author

+
+

Arguments

+
x
+

a SpatialPolygonsDataFrame object in a projected CRS with units of meters

-

D.E. Beaudette

-

Note

+
polygon.id
+

name of attribute in x that contains a unique ID for each polygon

-

This function expects that x has coordinates associated with a projected CRS and units of meters.

-

See also

+
parallel
+

invoke parallel back-end

+ +
cores
+

number of CPU cores to use for parallel operation

+ +
n.pts.per.ac
+

requested sampling density in points per acre (results will be close)

- +
min.samples
+

minimum requested number of samples per polygon

+ +
sampling.type
+

sampling type

+ +
+
+

Value

+

a SpatialPointsDataFrame object

+
+
+

Author

+

D.E. Beaudette

+
+
+

Note

+

This function expects that x has coordinates associated with a projected CRS and units of meters.

+
+
+

See also

+ +
+
-
- - + + diff --git a/docs/reference/dailyWB.html b/docs/reference/dailyWB.html index 0d96ab94..66b41d80 100644 --- a/docs/reference/dailyWB.html +++ b/docs/reference/dailyWB.html @@ -1,67 +1,12 @@ - - - - - - - -Simple Daily Water Balance — dailyWB • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple Daily Water Balance — dailyWB • sharpshootR - - + + - - -
-
- -
- -
+
@@ -117,73 +52,84 @@

Simple Daily Water Balance

Simple interface to the hydromad "leaky bucket" soil moisture model, with accommodation for typical inputs from common soil data and climate sources. Critical points along the water retention curve are specified using volumetric water content (VWC): satiation (saturation), field capacity (typically 1/3 bar suction), and permanent wilting point (typically 15 bar suction).

-
dailyWB(x, daily.data, id, S_0 = 0.5)
+
+
dailyWB(x, daily.data, id, MS.style = "default", S_0 = 0.5, M = 0, etmult = 1)
+
-

Arguments

- - - - - - - - - - - - - - - - - - -
x

data.frame, required columns include:

    -
  • sat: VWC at satiation

  • +
    +

    Arguments

    +
    x
    +

    data.frame, required columns include:

    • sat: VWC at satiation

    • fc: VWC at field capacity

    • pwp: VWC at permanent wilting point

    • thickness: soil material thickness in cm

    • a.ss: recession coefficients for subsurface flow from saturated zone, should be > 0 (range: 0-1)

    • "id"

    • -
daily.data

data.frame, required columns include:

    -
  • date: Date class representation of dates

  • +
+ + +
daily.data
+

data.frame, required columns include:

  • date: Date class representation of dates

  • PPT: daily total, precipitation in mm

  • PET: daily total, potential ET in mm

  • -
id

character, name of column in x that is used to identify records

S_0

fraction of water storage filled at time = 0 (range: 0-1)

- -

Value

- -

a data.frame

-

References

+ + + +
id
+

character, name of column in x that is used to identify records

+ + +
MS.style
+

moisture state classification style, see estimateSoilMoistureState

+ +
S_0
+

fraction of water storage filled at time = 0 (range: 0-1)

+ + +
M
+

fraction of area covered by deep-rooted vegetation

+ + +
etmult
+

multiplier for PET

+ +
+
+

Value

+ + +

a data.frame

+ + +
+
+

References

Farmer, D., M. Sivapalan, Farmer, D. (2003). Climate, soil and vegetation controls upon the variability of water balance in temperate and semiarid landscapes: downward approach to water balance analysis. Water Resources Research 39(2), p 1035.

Bai, Y., T. Wagener, P. Reed (2009). A top-down framework for watershed model evaluation and selection under uncertainty. Environmental Modelling and Software 24(8), pp. 901-916.

+
+
- - - + + diff --git a/docs/reference/dailyWB_SSURGO.html b/docs/reference/dailyWB_SSURGO.html index de751bb3..fe4fbc2d 100644 --- a/docs/reference/dailyWB_SSURGO.html +++ b/docs/reference/dailyWB_SSURGO.html @@ -1,67 +1,12 @@ - - - - - - - -Perform daily water balance modeling using SSURGO and DAYMET — dailyWB_SSURGO • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Perform daily water balance modeling using SSURGO and DAYMET — dailyWB_SSURGO • sharpshootR - - + + - - -
-
- -
- -
+
-

Perform daily water balance modeling using SSURGO and DAYMET

+

Pending.

+
+ +
+
dailyWB_SSURGO(
+  x,
+  cokeys = NULL,
+  start = 1988,
+  end = 2018,
+  modelDepth = 100,
+  MS.style = "default",
+  a.ss = 0.1,
+  S_0 = 0.5,
+  bufferRadiusMeters = 1
+)
-
dailyWB_SSURGO(
-  x,
-  cokeys = NULL,
-  start = 1988,
-  end = 2018,
-  modelDepth = 100,
-  bufferRadiusMeters = 1,
-  ...
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

SpatialPoints object representing a single point

cokeys

vector of component keys to use

start

starting year (limited to DAYMET holdings)

end

ending year (limited to DAYMET holdings)

modelDepth

soil depth used for water balance, see details

bufferRadiusMeters

spatial buffer (meters) applied to x for the lookup of SSURGO data

...

additional arguments to simpleWB

- -

Value

- -

data.frame of daily water balance results

-

References

+
+

Arguments

+
x
+

sf object representing a single point

-

Farmer, D., M. Sivapalan, Farmer, D. (2003). Climate, soil and vegetation controls upon the variability of water balance in temperate and semiarid landscapes: downward approach to water balance analysis. Water Resources Research 39(2), p 1035.

-

Author

+
cokeys
+

vector of component keys to use

+ + +
start
+

starting year (limited to DAYMET holdings)

+ + +
end
+

ending year (limited to DAYMET holdings)

+ + +
modelDepth
+

soil depth used for water balance, see details

+ + +
MS.style
+

moisture state classification style, see estimateSoilMoistureState

+ + +
a.ss
+

recession coefficients for subsurface flow from saturated zone, should be > 0 (range: 0-1)

+ + +
S_0
+

fraction of water storage filled at time = 0 (range: 0-1)

+ + +
bufferRadiusMeters
+

spatial buffer (meters) applied to x for the look-up of SSURGO data

+ +
+
+

Value

+ + +

data.frame of daily water balance results

+
+
+

References

+

Farmer, D., M. Sivapalan, Farmer, D. (2003). Climate, soil and vegetation controls upon the variability of water balance in temperate and semiarid landscapes: downward approach to water balance analysis. Water Resources Research 39(2), p 1035.

+
+
+

Author

D.E. Beaudette

+
+
-
- - + + diff --git a/docs/reference/diagnosticPropertyPlot-1.png b/docs/reference/diagnosticPropertyPlot-1.png index e5ddcdf5..c8941c1c 100644 Binary files a/docs/reference/diagnosticPropertyPlot-1.png and b/docs/reference/diagnosticPropertyPlot-1.png differ diff --git a/docs/reference/diagnosticPropertyPlot-2.png b/docs/reference/diagnosticPropertyPlot-2.png index 4d8d9fe9..f1490e64 100644 Binary files a/docs/reference/diagnosticPropertyPlot-2.png and b/docs/reference/diagnosticPropertyPlot-2.png differ diff --git a/docs/reference/diagnosticPropertyPlot.html b/docs/reference/diagnosticPropertyPlot.html index 35f2ef93..733cf383 100644 --- a/docs/reference/diagnosticPropertyPlot.html +++ b/docs/reference/diagnosticPropertyPlot.html @@ -1,67 +1,12 @@ - - - - - - - -Diagnostic Property Plot — diagnosticPropertyPlot • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Diagnostic Property Plot (base graphics) — diagnosticPropertyPlot • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,125 +52,139 @@

Diagnostic Property Plot

Generate a graphical description of the presence/absence of soil diagnostic properties.

-
diagnosticPropertyPlot(f, v, k, grid.label='pedon_id', 
-dend.label='pedon_id', sort.vars=TRUE)
-diagnosticPropertyPlot2(f, v, k, grid.label='pedon_id', sort.vars=TRUE)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
f

a SoilProfileCollection object

v

a character vector of site-level attribute names that are boolean (e.g. TRUE/FALSE) data

k

an integer, number of groups to highlight

grid.label

the name of a site-level attribute (usually unique) annotating the y-axis of the grid

dend.label

the name of a site-level attribute (usually unique) annotating dendrogram terminal leaves

sort.vars

sort variables according to natural clustering (TRUE), or use supplied ordering in v (FALSE)

- -

Details

+
+
diagnosticPropertyPlot(
+  f,
+  v,
+  k,
+  grid.label = "pedon_id",
+  dend.label = "pedon_id",
+  sort.vars = TRUE
+)
+
-

This function attempts to display several pieces of information within a single figure. First, soil profiles are sorted according to the presence/absence of diagnostic features named in v. Second, these diagnostic features are sorted according to their distribution among soil profiles. Third, a binary grid is established with row-ordering of profiles based on step 1 and column-ordering based on step 2. Blue cells represent the presence of a diagnostic feature. Soils with similar diagnostic features should 'clump' together. See examples below.

-

Value

+
+

Arguments

+
f
+

SoilProfileCollection object

-

a list is silently returned by this function, containing:

-
rd

a data.frame containing IDs and grouping code

-
profile.order

a vector containing the order of soil profiles (row-order in figure), according to diagnostic property values

-
var.order

a vector containing the order of variables (column-order in figure), according to their distribution among profiles

-
+
v
+

character vector of site-level attribute names of logical type

-

Author

-

D.E. Beaudette and J.M. Skovlin

-

See also

+
k
+

an integer, number of groups to highlight

- -

Examples

-
# \donttest{ +
grid.label
+

the name of a site-level attribute (usually unique) annotating the y-axis of the grid

-if(require(aqp) & - require(soilDB) & - require(latticeExtra) - ) { - - # sample data, an SPC -data(gopheridge, package='soilDB') -# get depth class -sdc <- getSoilDepthClass(gopheridge) -site(gopheridge) <- sdc +
dend.label
+

the name of a site-level attribute (usually unique) annotating dendrogram terminal leaves

-# diagnostic properties to consider, no need to convert to factors -v <- c('lithic.contact', 'paralithic.contact', 'argillic.horizon', -'cambic.horizon', 'ochric.epipedon', 'mollic.epipedon', 'very.shallow', -'shallow', 'mod.deep', 'deep', 'very.deep') -# base graphics -x <- diagnosticPropertyPlot(gopheridge, v, k=5) +
sort.vars
+

sort variables according to natural clustering (TRUE), or use supplied ordering in v

-# lattice graphics -x <- diagnosticPropertyPlot2(gopheridge, v, k=3) +
+
+

Value

+ -# check output -str(x) - -} -
#> List of 3 -#> $ rd :'data.frame': 52 obs. of 3 variables: -#> ..$ peiid : chr [1:52] "1137354" "1147151" "1147190" "242808" ... -#> ..$ pedon_id: chr [1:52] "08DWB028" "07RJV098" "07RJV099" "S2007CA009002" ... -#> ..$ g : int [1:52] 1 2 2 1 1 1 1 1 1 1 ... -#> $ profile.order: int [1:52] 1 4 6 7 8 9 15 16 17 21 ... -#> $ var.order : int [1:8] 1 3 5 8 2 4 6 7
+

a list is silently returned by this function, containing:

rd
+

a data.frame containing IDs and grouping code

+ +
profile.order
+

a vector containing the order of soil profiles (row-order in figure), according to diagnostic property values

+
var.order
+

a vector containing the order of variables (column-order in figure), according to their distribution among profiles

-# } -
+
+
+

Details

+

This function attempts to display several pieces of information within a single figure. First, soil profiles are sorted according to the presence/absence of diagnostic features named in v. Second, these diagnostic features are sorted according to their distribution among soil profiles. Third, a binary grid is established with row-ordering of profiles based on step 1 and column-ordering based on step 2. Blue cells represent the presence of a diagnostic feature. Soils with similar diagnostic features should 'clump' together. See examples below.

+
+
+

See also

+ +
+
+

Author

+

D.E. Beaudette and J.M. Skovlin

+
+ +
+

Examples

+

+# \donttest{
+
+if(require(aqp) &
+   require(soilDB) &
+   require(latticeExtra)
+) {
+  
+  # sample data, an SPC
+  data(gopheridge, package='soilDB')
+  
+  # get depth class
+  sdc <- getSoilDepthClass(gopheridge, name = 'hzname')
+  site(gopheridge) <- sdc
+  
+  # diagnostic properties to consider, no need to convert to factors
+  v <- c('lithic.contact', 'paralithic.contact', 'argillic.horizon', 
+         'cambic.horizon', 'ochric.epipedon', 'mollic.epipedon', 'very.shallow',
+         'shallow', 'mod.deep', 'deep', 'very.deep')
+  
+  # base graphics
+  x <- diagnosticPropertyPlot(gopheridge, v, k=5)
+  
+  # lattice graphics
+  x <- diagnosticPropertyPlot2(gopheridge, v, k=3)
+  
+  # check output
+  str(x)
+  
+}
+#> Loading required package: latticeExtra
+#> Loading required package: lattice
+
+
+#> List of 3
+#>  $ rd           :'data.frame':	52 obs. of  3 variables:
+#>   ..$ peiid   : chr [1:52] "1137354" "1147151" "1147190" "242808" ...
+#>   ..$ pedon_id: chr [1:52] "08DWB028" "07RJV098" "07RJV099" "S2007CA009002" ...
+#>   ..$ g       : int [1:52] 1 2 2 1 1 1 1 1 1 1 ...
+#>  $ profile.order: int [1:52] 1 4 6 7 8 9 15 16 17 21 ...
+#>  $ var.order    : int [1:8] 1 3 5 8 2 4 6 7
+
+# }
+
+
+
- - - + + diff --git a/docs/reference/dist.along.grad.html b/docs/reference/dist.along.grad.html index 852f8721..c905c25c 100644 --- a/docs/reference/dist.along.grad.html +++ b/docs/reference/dist.along.grad.html @@ -1,67 +1,12 @@ - - - - - - - -Compute Euclidean distance along a gradient. — dist.along.grad • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Compute Euclidean distance along a gradient. — dist.along.grad • sharpshootR - - - - + + -
-
- -
- -
+
-
dist.along.grad(coords, var, grad.order, grad.scaled.min, grad.scaled.max)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
coords

a matrix of x and y coordinates in some projected coordinate system

var

a vector of the same length as coords, describing the gradient of interest

grad.order

vector of integers that define ordering of coordinates along gradient

grad.scaled.min

min value of rescaled gradient values

grad.scaled.max

max value of rescaled gradient values

- -

Details

- -

This function is primarily intended for use within plotTransect.

-

Value

- -

A data.frame object:

-
scaled.grad

scaled gradient values

-
scaled.distance

cumulative distance, scaled to the interval of 0.5, nrow(coords) + 0.5

-
distance

cumulative distance computed along gradient, e.g. transect distance

-
variable

sorted gradient values

-
x

x coordinates, ordered by gradient values

-
y

y coordinate, ordered by gradient values

-
grad.order

a vector index describing the sort order defined by gradient values

- -
+
+
dist.along.grad(coords, var, grad.order, grad.scaled.min, grad.scaled.max)
+
-

Author

+
+

Arguments

+
coords
+

a matrix of x and y coordinates in some projected coordinate system

-

D.E. Beaudette

-

Note

+
var
+

a vector of the same length as coords, describing the gradient of interest

-

This function is very much a work in progress, ideas welcome.

-

See also

+
grad.order
+

vector of integers that define ordering of coordinates along gradient

+ +
grad.scaled.min
+

min value of rescaled gradient values

+ +
grad.scaled.max
+

max value of rescaled gradient values

+ +
+
+

Details

+

This function is primarily intended for use within plotTransect.

+
+
+

Value

+

A data.frame object:

scaled.grad
+

scaled gradient values

+ +
scaled.distance
+

cumulative distance, scaled to the interval of 0.5, nrow(coords) + 0.5

+ +
distance
+

cumulative distance computed along gradient, e.g. transect distance

- +
variable
+

sorted gradient values

+ +
x
+

x coordinates, ordered by gradient values

+ +
y
+

y coordinate, ordered by gradient values

+ +
grad.order
+

a vector index describing the sort order defined by gradient values

+ + +
+
+

Author

+

D.E. Beaudette

+
+
+

Note

+

This function is very much a work in progress, ideas welcome.

+
+
+

See also

+ +
+
-
- - + + diff --git a/docs/reference/dueling.dendrograms.html b/docs/reference/dueling.dendrograms.html index bb5014e7..da641ccb 100644 --- a/docs/reference/dueling.dendrograms.html +++ b/docs/reference/dueling.dendrograms.html @@ -1,67 +1,12 @@ - - - - - - - -Dueling Dendrograms — dueling.dendrograms • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Dueling Dendrograms — dueling.dendrograms • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,109 +52,79 @@

Dueling Dendrograms

Graphically compare two related dendrograms

-
dueling.dendrograms(p.1, p.2, lab.1 = "D1", 
-lab.2 = "D2", cex.nodelabels=0.75, arrow.length=0.05)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
p.1

left-hand phylo-class dendrogram

p.2

right-hand phylo-class dendrogram

lab.1

left-hand title

lab.2

right-hand title

cex.nodelabels

character expansion size for node labels

arrow.length

arrow head size

- -

Author

- -

D. E. Beaudette

-

Details

+
+
dueling.dendrograms(
+  p.1,
+  p.2,
+  lab.1 = "D1",
+  lab.2 = "D2",
+  cex.nodelabels = 0.75,
+  arrow.length = 0.05
+)
+
-

Connector arrows are used to link nodes from the left-hand dendrogram to the right-hand dendrogram.

+
+

Arguments

+
p.1
+

left-hand phylo-class dendrogram

-

Examples

-
if(require(aqp) & - require(cluster) & - require(latticeExtra) & - require(ape) -) { - - # load sample dataset from aqp package -data(sp3) -# promote to SoilProfileCollection -depths(sp3) <- id ~ top + bottom +
p.2
+

right-hand phylo-class dendrogram

-# compute dissimilarity using different sets of variables -# note that these are rescaled to the interval [0,1] -d.1 <- profile_compare(sp3, vars=c('clay', 'cec'), k=0, max_d=100, rescale.result=TRUE) -d.2 <- profile_compare(sp3, vars=c('clay', 'L'), k=0, max_d=100, rescale.result=TRUE) -# cluster via divisive hierarchical algorithm -# convert to 'phylo' class -p.1 <- as.phylo(as.hclust(diana(d.1))) -p.2 <- as.phylo(as.hclust(diana(d.2))) +
lab.1
+

left-hand title

-# graphically compare two dendrograms -dueling.dendrograms(p.1, p.2, lab.1='clay and CEC', lab.2='clay and L') -# graphically check the results of ladderize() from ape package -dueling.dendrograms(p.1, ladderize(p.1), lab.1='standard', lab.2='ladderized') +
lab.2
+

right-hand title

-# sanity-check: compare something to itself -dueling.dendrograms(p.1, p.1, lab.1='same', lab.2='same') -# graphically compare diana() to agnes() using d.2 -dueling.dendrograms(as.phylo(as.hclust(diana(d.2))), -as.phylo(as.hclust(agnes(d.2))), lab.1='diana', lab.2='agnes') -} -
#> Loading required package: cluster
#> Warning: package 'cluster' was built under R version 4.0.4
#> Loading required package: ape
#> Warning: package 'ape' was built under R version 4.0.3
#> Computing dissimilarity matrices from 10 profiles
#> [0.22 Mb]
#> Computing dissimilarity matrices from 10 profiles
#> [0.22 Mb]
+
cex.nodelabels
+

character expansion size for node labels

+ + +
arrow.length
+

arrow head size

+ +
+
+

Value

+ + +

nothing is returned, function is called to generate graphical output

+
+
+

Details

+

Connector arrows are used to link nodes from the left-hand dendrogram to the right-hand dendrogram.

+
+
+

Author

+

D.E. Beaudette

+
-
+
- - - + + diff --git a/docs/reference/estimateSoilMoistureState.html b/docs/reference/estimateSoilMoistureState.html index 6e0c6c2c..0dd7a573 100644 --- a/docs/reference/estimateSoilMoistureState.html +++ b/docs/reference/estimateSoilMoistureState.html @@ -1,75 +1,20 @@ - - - - - - - -A very simple estimation of soil moisture state based on volumetric water content — estimateSoilMoistureState • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -A very simple estimation of soil moisture state based on volumetric water content — estimateSoilMoistureState • sharpshootR - - - +VWC &gt; fc AND U (surplus) &gt; 4mm: "wet" - - - - - - - + + - - -
-
- -
- -
+
-

This is a very simple classification of volumetric water content (VWC) into 5 "moisture states", based on an interpretation of water retention thresholds. Classification is performed using VWC at satiation, field capacity (typically 1/3 bar suction), permanent wilting point (typically 15 bar suction), and water surplus in mm. The inputs to this function are closely aligned with the assumptions and output from hydromad::hydromad(sma = 'bucket', ...).

-

Soil moisture classification rules are as follows:

    -
  • VWC <= pwp: "very dry"

  • -
  • VWC > pwp and <= (mid-point between fc and pwp): "dry"

  • -
  • VWC > (mid-point between fc and pwp) and <= fc: "moist"

  • +

    This is a very simple classification of volumetric water content (VWC) into 5 "moisture states", based on an interpretation of water retention thresholds. Classification is performed using VWC at satiation, field capacity (typically 1/3 bar suction), permanent wilting point (typically 15 bar suction), and water surplus in mm. The inputs to this function are closely aligned with the assumptions and output from hydromad::hydromad(sma = 'bucket', ...).

    +

    Soil moisture classification rules are as follows:

    • VWC <= pwp: "very dry"

    • +
    • VWC > pwp AND <= (mid-point between fc and pwp): "dry"

    • +
    • VWC > (mid-point between fc and pwp) AND <= fc: "moist"

    • VWC > fc: "very moist"

    • -
    • U (surplus) > 2mm: "saturated / runoff"

    • -
    - +
  • VWC > fc AND U (surplus) > 4mm: "wet"

  • +
+ +
+
estimateSoilMoistureState(
+  VWC,
+  U,
+  sat,
+  fc,
+  pwp,
+  style = c("default", "newhall")
+)
-
estimateSoilMoistureState(VWC, U, sat, fc, pwp)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
VWC

vector of volumetric water content (VWC), range is 0-1

U

vector of surplus water (mm)

sat

satiation water content, range is 0-1

fc

field capacity water content, range is 0-1

pwp

permanent wilting point water content, range is 0-1

- -

Value

- -

vector of moisture states (ordered factor)

-

Author

+
+

Arguments

+
VWC
+

vector of volumetric water content (VWC), range is 0-1

+ + +
U
+

vector of surplus water (mm)

+ + +
sat
+

satiation water content, range is 0-1

+ +
fc
+

field capacity water content, range is 0-1

+ + +
pwp
+

permanent wilting point water content, range is 0-1

+ + +
style
+

VWC classification style

+ +
+
+

Value

+ + +

vector of moisture states (ordered factor)

+
+
+

Author

D.E. Beaudette

+
-

Examples

-
-# "very moist" -estimateSoilMoistureState(VWC = 0.3, U = 0, sat = 0.35, fc = 0.25, pwp = 0.15) -
#> [1] very moist -#> Levels: very dry < dry < moist < very moist < saturated / runoff
-# "very dry" -estimateSoilMoistureState(VWC = 0.15, U = 0, sat = 0.35, fc = 0.25, pwp = 0.15) -
#> [1] very dry -#> Levels: very dry < dry < moist < very moist < saturated / runoff
-
+
+

Examples

+

+# "very moist"
+estimateSoilMoistureState(VWC = 0.3, U = 0, sat = 0.35, fc = 0.25, pwp = 0.15)
+#> [1] very moist
+#> Levels: very dry < dry < moist < very moist < wet
+estimateSoilMoistureState(VWC = 0.3, U = 2, sat = 0.35, fc = 0.25, pwp = 0.15)
+#> [1] very moist
+#> Levels: very dry < dry < moist < very moist < wet
+
+"wet"
+#> [1] "wet"
+estimateSoilMoistureState(VWC = 0.3, U = 5, sat = 0.35, fc = 0.25, pwp = 0.15)
+#> [1] wet
+#> Levels: very dry < dry < moist < very moist < wet
+
+# "very dry"
+estimateSoilMoistureState(VWC = 0.15, U = 0, sat = 0.35, fc = 0.25, pwp = 0.15)
+#> [1] very dry
+#> Levels: very dry < dry < moist < very moist < wet
+
+# "dry" 
+estimateSoilMoistureState(VWC = 0.18, U = 0, sat = 0.35, fc = 0.25, pwp = 0.15)
+#> [1] dry
+#> Levels: very dry < dry < moist < very moist < wet
+
+
+
+
-
- - + + diff --git a/docs/reference/formatPLSS.html b/docs/reference/formatPLSS.html index a0ca0aed..997a57d5 100644 --- a/docs/reference/formatPLSS.html +++ b/docs/reference/formatPLSS.html @@ -1,67 +1,12 @@ - - - - - - - -formatPLSS — formatPLSS • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -formatPLSS — formatPLSS • sharpshootR - + + - - - -
-
- -
- -
+
@@ -117,84 +52,89 @@

formatPLSS

Format PLSS information into a coded format that can be digested by PLSS web service.

-
formatPLSS(p, type = "SN")
+
+
formatPLSS(p, type = "SN")
+
-

Arguments

- - - - - - - - - - -
p

data.frame with chunks of PLSS coordinates

type

an option to format protracted blocks 'PB', unprotracted blocks 'UP', or standard section number 'SN' (default).

+
+

Arguments

+
p
+

data.frame with chunks of PLSS coordinates

-

Value

-

A vector of PLSS codes.

-

Details

+
type
+

an option to format protracted blocks 'PB', unprotracted blocks 'UP', or standard section number 'SN' (default).

-

This function is typically accessed as a helper function to prepare data for use within PLSS2LL function.

-

Note

+
+
+

Value

+ +

A vector of PLSS codes.

+
+
+

Details

+

This function is typically accessed as a helper function to prepare data for use within PLSS2LL function.

+
+
+

Note

This function expects that the Polygon object has coordinates associated with a projected CRS-- e.g. units of meters.

This function requires the following packages: stringi.

-

See also

- - -

Author

- +
+
+

See also

+ +
+
+

Author

D.E. Beaudette, Jay Skovlin, A.G. Brown

+
-

Examples

-
# create some data -d <- data.frame( - id = 1:3, - qq = c('SW', 'SW', 'SE'), - q = c('NE', 'NW', 'SE'), - s = c(17, 32, 30), - t = c('T36N', 'T35N', 'T35N'), - r = c('R29W', 'R28W', 'R28W'), - type = 'SN', - m = 'MT20', - stringsAsFactors = FALSE -) -# add column names - -names(d) <- c('id', 'qq', 'q', 's', 't', 'r', 'type', 'm') -# generate formatted PLSS codes -formatPLSS(d, type='SN') -
#> [1] "MT200360N0290W0SN170ASWNE" "MT200350N0280W0SN320ASWNW" -#> [3] "MT200350N0280W0SN300ASESE"
-
+
+

Examples

+
# create some data
+d <- data.frame(
+  id = 1:3,
+  qq = c('SW', 'SW', 'SE'),
+  q = c('NE', 'NW', 'SE'),
+  s = c(17, 32, 30),
+  t = c('T36N', 'T35N', 'T35N'),
+  r = c('R29W', 'R28W', 'R28W'),
+  type = 'SN',
+  m = 'MT20',
+  stringsAsFactors = FALSE
+)
+# add column names
+
+names(d) <- c('id', 'qq', 'q', 's', 't', 'r', 'type', 'm')
+# generate formatted PLSS codes
+formatPLSS(d, type='SN')
+#> [1] "MT200360N0290W0SN170ASWNE" "MT200350N0280W0SN320ASWNW"
+#> [3] "MT200350N0280W0SN300ASESE"
+
+
+
+
- - - + + diff --git a/docs/reference/generateLineHash.html b/docs/reference/generateLineHash.html index bc1573a2..c1ba755b 100644 --- a/docs/reference/generateLineHash.html +++ b/docs/reference/generateLineHash.html @@ -1,67 +1,12 @@ - - - - - - - -Generate a unique ID for line segments — generateLineHash • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Generate a unique ID for line segments — generateLineHash • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,63 +52,108 @@

Generate a unique ID for line segments

Generate a unique ID for a line segment, based on the non-cryptographic murmur32 hash.

-
generateLineHash(x, precision=-1, algo='murmur32')
+
+
generateLineHash(x, precision = -1, algo = "murmur32")
+
+ +
+

Arguments

+
x
+

an sf object, with 1 line segment per feature

-

Arguments

- - - - - - - - - - - - - - -
x

a SpatialLinesDataFrame object, with 1 line segment per feature (e.g. simple features)

precision

digits are rounded to this many places to the right (negative) or left (positive) of the decimal place

algo

hash function algorithm

-

Details

+
precision
+

digits are rounded to this many places to the right (negative) or left (positive) of the decimal place

-

The input SpatialLinesDataFrame object must NOT contain multi-part features. The precision specified should be tailored to the coordinate system in use and the snapping tolerance used to create join decision line segments. A precision of 4 is reasonable for geographic coordinates (snapping tolerance of 0.0001 degrees or ~ 10 meters). A precision of -1 (snapping tolerance of 10 meters) is reasonable for projected coordinate systems with units in meters.

-

Value

-

A vector of unique IDs created from the hash of line segment start and end vertex coordinates. Unique IDs are returned in the order of records of x and can therefore be saved into a new column of the associated attribute table.

-

Note

+
algo
+

hash function algorithm, passed to digest::digest()

-

An error is issued if any non-unique IDs are generated. This could be casued by using coordiantes that do not contain enough precision for unique hashing.

-

Author

+
+
+

Value

+ +

A vector of unique IDs created from the hash of line segment start and end vertex coordinates. Unique IDs are returned in the order of records of x and can therefore be saved into a new column of the associated attribute table. NA is returned for empty geometries.

+
+
+

Details

+

The input sf object must NOT contain multi-part features. The precision specified should be tailored to the coordinate system in use and the snapping tolerance used to create join decision line segments. A precision of 4 is reasonable for geographic coordinates (snapping tolerance of 0.0001 degrees or ~ 10 meters). A precision of -1 (snapping tolerance of 10 meters) is reasonable for projected coordinate systems with units in meters.

+
+
+

Note

+

An error is issued if any non-unique IDs are generated. This could be caused by using coordinates that do not contain enough precision for unique hashing.

+
+
+

Author

D.E. Beaudette

+
+
+

Examples

+

+if(requireNamespace("sf")) {
+
+# 10 random line segments
+# shared end vertices
+.x <- runif(n = 11, min = 0, max = 100)
+.y <- runif(n = 11, min = 0, max = 100)
+m <- matrix(c(.x, .y), ncol = 2, byrow = TRUE)
+
+# init LINESTRING geometries
+a <- lapply(1:(nrow(m) - 1), function(i) {
+  .idx <- c(i, i+1)
+  geom <- sf::st_sfc(sf::st_linestring(m[.idx, ]))
+  a <- sf::st_sf(geom)
+  
+})
+
+# flatten list -> 10 feature sf object
+a <- do.call('rbind', a)
+
+# line hashes
+a$id <- generateLineHash(a, precision = 0)
+
+# graphical check
+plot(a, lwd = 2, key.width = lcm(4), axes = TRUE, las = 1)
+
+
+# simulate empty geometry
+a$geom[2] <- sf::st_sfc(sf::st_linestring())
+
+# NA returned for empty geometry
+generateLineHash(a, precision = 0)
+
+}
+#> Loading required namespace: sf
+
+#>  [1] "a149a7b5" NA         "3aa8ae21" "3cd09317" "4d71a738" "4cfb6777"
+#>  [7] "1fa21304" "dcb7a486" "30b1375d" "4e78e7bc"
+
+
+
+
+
- - - + + diff --git a/docs/reference/geomorphBySoilSeries-SSURGO.html b/docs/reference/geomorphBySoilSeries-SSURGO.html index f363954a..17c3bad1 100644 --- a/docs/reference/geomorphBySoilSeries-SSURGO.html +++ b/docs/reference/geomorphBySoilSeries-SSURGO.html @@ -1,67 +1,12 @@ - - - - - - - -Geomorphic Position Probability via SDA — geomorphBySoilSeries-SSURGO • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Geomorphic Position Probability via SDA — geomorphBySoilSeries-SSURGO • sharpshootR - - - - + + -
-
- -
- -
+
-
hillslopeProbability(s, replaceNA=TRUE)
-surfaceShapeProbability(s, replaceNA=TRUE)
-geomPosHillProbability(s, replaceNA=TRUE)
-geomPosMountainProbability(s, replaceNA=TRUE)
- -

Arguments

- - - - - - - - - - -
s

a character vector of soil series names, automatically normalized to upper case

replaceNA

boolean: should missing classes be converted to probabilities of 0?

- -

Details

+
+
hillslopeProbability(s, replaceNA=TRUE)
+surfaceShapeProbability(s, replaceNA=TRUE)
+geomPosHillProbability(s, replaceNA=TRUE)
+geomPosMountainProbability(s, replaceNA=TRUE)
+
-

These functions send a query to the SDA webservice. Further information on the SDA webservice and query examples can be found at http://sdmdataaccess.nrcs.usda.gov/QueryHelp.aspx

-

Value

+
+

Arguments

+
s
+

a character vector of soil series names, automatically normalized to upper case

-

A data.frame object with rows representing soil series, and columns representing probability estimates of that series occuring at specificed geomorphic positions or associated with a surface shape.

-

Note

+
replaceNA
+

boolean: should missing classes be converted to probabilities of 0?

+
+
+

Details

+

These functions send a query to the SDA webservice. Further information on the SDA webservice and query examples can be found at http://sdmdataaccess.nrcs.usda.gov/QueryHelp.aspx

+
+
+

Value

+

A data.frame object with rows representing soil series, and columns representing probability estimates of that series occurring at specified geomorphic positions or associated with a surface shape.

+
+
+

Note

Probability values are computed from SSURGO data.

-

Author

- +
+
+

Author

D.E. Beaudette

+
-

Examples

-
# \donttest{ - -if(requireNamespace("curl") & - curl::has_internet() & - require(soilDB)) { - - # soil series of interest -s <- c('amador', 'peters', 'pentz', 'inks', 'auburn', 'dunstone', 'argonaut') - -# generate hillslope probability table -hillslopeProbability(s) - -# generate surface 2D shape probability table -surfaceShapeProbability(s) - -} -
#> Warning: This function is now deprecated, consider using soilDB::fetchSDA() or soilDB::fetchOSD(..., extended = TRUE)
#> single result set, returning a data.frame
#> Warning: This function is now deprecated, consider using soilDB::fetchSDA() or soilDB::fetchOSD(..., extended = TRUE)
#> single result set, returning a data.frame
#> compname Convex/Convex Linear/Convex Convex/Linear Concave/Convex -#> 1 AMADOR 0.50 0.10 0.00 0 -#> 2 ARGONAUT 0.03 0.00 0.00 0 -#> 3 AUBURN 0.03 0.08 0.02 0 -#> 4 DUNSTONE 0.06 0.00 0.06 0 -#> 5 INKS 0.30 0.20 0.00 0 -#> 6 PENTZ 0.70 0.02 0.01 0 -#> 7 PETERS 0.00 0.00 0.00 0 -#> Linear/Linear Concave/Linear Convex/Concave Linear/Concave Concave/Concave -#> 1 0.30 0.07 0.00 0.00 0.03 -#> 2 0.78 0.00 0.01 0.05 0.12 -#> 3 0.06 0.00 0.68 0.06 0.07 -#> 4 0.17 0.00 0.33 0.11 0.28 -#> 5 0.10 0.00 0.25 0.00 0.15 -#> 6 0.16 0.00 0.03 0.05 0.02 -#> 7 0.29 0.04 0.16 0.45 0.07
-# } -
+
+

Examples

+
# \donttest{
+
+if(requireNamespace("curl") &
+   curl::has_internet() &
+   require(soilDB)) {
+  
+  # soil series of interest
+s <- c('amador', 'peters', 'pentz', 'inks', 'auburn', 'dunstone', 'argonaut')
+
+# generate hillslope probability table
+hillslopeProbability(s)
+
+# generate surface 2D shape probability table
+surfaceShapeProbability(s)
+  
+}
+#> Warning: This function is now deprecated, consider using soilDB::fetchSDA() or soilDB::fetchOSD(..., extended = TRUE)
+#> single result set, returning a data.frame
+#> Warning: This function is now deprecated, consider using soilDB::fetchSDA() or soilDB::fetchOSD(..., extended = TRUE)
+#> single result set, returning a data.frame
+#>   compname Convex/Convex Linear/Convex Convex/Linear Concave/Convex
+#> 1   AMADOR          0.50          0.10          0.00              0
+#> 2 ARGONAUT          0.03          0.00          0.00              0
+#> 3   AUBURN          0.06          0.09          0.07              0
+#> 4 DUNSTONE          0.43          0.00          0.03              0
+#> 5     INKS          0.39          0.17          0.20              0
+#> 6    PENTZ          0.65          0.02          0.11              0
+#> 7   PETERS          0.00          0.00          0.00              0
+#>   Linear/Linear Concave/Linear Convex/Concave Linear/Concave Concave/Concave
+#> 1          0.30           0.07           0.00           0.00            0.03
+#> 2          0.78           0.00           0.01           0.05            0.12
+#> 3          0.08           0.03           0.58           0.06            0.04
+#> 4          0.10           0.00           0.20           0.07            0.17
+#> 5          0.15           0.00           0.10           0.00            0.00
+#> 6          0.15           0.00           0.02           0.05            0.00
+#> 7          0.32           0.07           0.14           0.45            0.02
+
+# }
+
+
+
-
- - + + diff --git a/docs/reference/huePositionPlot-1.png b/docs/reference/huePositionPlot-1.png index 27a56637..2866e8b8 100644 Binary files a/docs/reference/huePositionPlot-1.png and b/docs/reference/huePositionPlot-1.png differ diff --git a/docs/reference/huePositionPlot-2.png b/docs/reference/huePositionPlot-2.png index a6d41217..a0c6e1f9 100644 Binary files a/docs/reference/huePositionPlot-2.png and b/docs/reference/huePositionPlot-2.png differ diff --git a/docs/reference/huePositionPlot-3.png b/docs/reference/huePositionPlot-3.png index 6c9675ad..e194c776 100644 Binary files a/docs/reference/huePositionPlot-3.png and b/docs/reference/huePositionPlot-3.png differ diff --git a/docs/reference/huePositionPlot-4.png b/docs/reference/huePositionPlot-4.png index c8d102df..75b79bc4 100644 Binary files a/docs/reference/huePositionPlot-4.png and b/docs/reference/huePositionPlot-4.png differ diff --git a/docs/reference/huePositionPlot.html b/docs/reference/huePositionPlot.html index ef96424f..927f0238 100644 --- a/docs/reference/huePositionPlot.html +++ b/docs/reference/huePositionPlot.html @@ -1,67 +1,12 @@ - - - - - - - -Hue Position Chart — huePositionPlot • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Hue Position Chart — huePositionPlot • sharpshootR - + + - - - -
-
- -
- -
+
-

A simple visualization of the hue positions for a given Munsell value/chroma according to Soil Survey Technical Note 2.

+

A simple visualization of the hue positions for a given Munsell value/chroma according to Soil Survey Technical Note 2.

+
+ +
+
huePositionPlot(
+  value = 6,
+  chroma = 6,
+  chip.cex = 4.5,
+  label.cex = 0.75,
+  contour.dE00 = FALSE,
+  origin = NULL,
+  origin.cex = 0.75,
+  grid.res = 2
+)
-
huePositionPlot(
-  value = 6,
-  chroma = 6,
-  chip.cex = 4.5,
-  label.cex = 0.75,
-  contour.dE00 = FALSE,
-  grid.res = 2
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
value

a single Munsell value

chroma

a single Munsell chroma

chip.cex

scaling for color chip rectangle

label.cex

scaling for color chip

contour.dE00

logical, add dE00 contours from CIELAB coordinates (L,0,0), L is a constant value determined by value and chroma

grid.res

grid resolution for contours, units are CIELAB A/B coordinates. Caution, small values result in many pair-wise distances which could take a very long time.

- - -

Examples

-
-huePositionPlot(value = 4, chroma = 4) -
-huePositionPlot(value = 6, chroma = 6) -
-huePositionPlot(value = 8, chroma = 8) -
-huePositionPlot(value = 6, chroma = 6, contour.dE00 = TRUE, grid.res = 2) -
-
+
+

Arguments

+
value
+

a single Munsell value

+ + +
chroma
+

a single Munsell chroma

+ + +
chip.cex
+

scaling for color chip rectangle

+ + +
label.cex
+

scaling for color chip

+ + +
contour.dE00
+

logical, add dE00 contours from origin, imlpicitly TRUE when origin is not NULL

+ + +
origin
+

point used for distance comparisons can be either single row matrix of CIELAB coordinates, a character vector specifying a Munsell color. By default (NULL) represents CIELAB coordinates (L,0,0), where L is a constant value determined by value and chroma. See examples.

+ + +
origin.cex
+

scaling for origin point

+ + +
grid.res
+

grid resolution for contours, units are CIELAB A/B coordinates. Caution, small values result in many pair-wise distances which could take a very long time.

+ +
+
+

Value

+ + +

nothing, function is called to generate graphical output

+
+ +
+

Examples

+

+huePositionPlot(value = 4, chroma = 4)
+
+
+huePositionPlot(value = 6, chroma = 6)
+
+
+huePositionPlot(value = 8, chroma = 8)
+
+
+huePositionPlot(value = 6, chroma = 6, contour.dE00 = TRUE, grid.res = 2)
+
+
+# shift origin to arbitrary CIELAB coordinates or Munsell color
+huePositionPlot(origin = cbind(40, 5, 15), origin.cex = 0.5)
+
+
+huePositionPlot(origin = '5G 6/4', origin.cex = 0.5)
+
+
+huePositionPlot(origin = '10YR 3/4', origin.cex = 0.5)
+
+
+huePositionPlot(value = 3, chroma = 4, origin = '10YR 3/4', origin.cex = 0.5)
+
+
+
+
-
- - + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 144d1760..b30212d1 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,66 +1,12 @@ - - - - - - - -Function reference • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function reference • sharpshootR + + - - - - -
-
- -
- -
+
- - - - - - - - - - -
-

All functions

+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - + + - - - - - - + + - - - - - - - - - - - - - - - - - - + + - - - + + - - - - - - - - - + + - - - - - - + + - - - + + - - - - - - - - - + + - - - - - - - + - - - - - - - - - + + - - - - - - - + - - - - - - + + - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - -
+

All functions

+

aggregateColorPlot()

Plot aggregate soil color data

+

amador

SSURGO Data Associated with the Amador Soil Series

+

aspect.plot()

Plot Aspect Data

+

CDEC.snow.courses

CDEC Snow Course List

+

CDECquery()

Easy Access to the CDEC API

+

CDECsnowQuery()

Get snow survey data (California only) from the CDEC website.

+

CDEC_StationInfo()

CDEC Sensor Details (by Station)

+

colorMixtureVenn()

Create a Venn Diagram of Simulated Color Mixtures

+

component.adj.matrix()

Create an adjacency matrix from a data.frame of component data

+

constantDensitySampling()

Constant Density Sampling

+

dailyWB()

Simple Daily Water Balance

+

dailyWB_SSURGO()

Perform daily water balance modeling using SSURGO and DAYMET

-

diagnosticPropertyPlot() diagnosticPropertyPlot2()

-

Diagnostic Property Plot

+
+

diagnosticPropertyPlot()

+

Diagnostic Property Plot (base graphics)

+

diagnosticPropertyPlot2()

+

Diagnostic Property Plot (lattice)

dist.along.grad()

Compute Euclidean distance along a gradient.

+

dueling.dendrograms()

Dueling Dendrograms

+
+

ESS_by_Moran_I()

+

Estimate Effective Sample Size

estimateSoilMoistureState()

A very simple estimation of soil moisture state based on volumetric water content

-

FFD() FFDplot()

+
+

FFD()

Frost-Free Day Evaluation

+
+

FFDplot()

+

Plot output from FFD()

formatPLSS()

formatPLSS

+

generateLineHash()

Generate a unique ID for line segments

+

hillslopeProbability() surfaceShapeProbability() geomPosHillProbability() geomPosMountainProbability()

Geomorphic Position Probability via SDA

+

HenryTimeLine()

Sensor Data Timeline from Henry Mount Soil and Water DB

+

HHM

Highland Meadows

+

huePositionPlot()

Hue Position Chart

+
+

hydOrder()

+

Hydrologic Ordering of a Geomorphic Proportion Matrix

isMineralSoilMaterial()

Mineral Soil Material Criteria from 12th Ed. of KST

+
+

iterateHydOrder()

+

Iteratively Attempt Hydrologic Ordering of Geomorphic Proportion Matrix

joinAdjacency()

Join Document Adjacency

+

LL2PLSS()

LL2PLSS

+

moistureStateProportions()

Compute moisture state proportions

+
+

moistureStateStats()

+

Statistics on Soil Moisture State

moistureStateThreshold()

Apply a threshold to soil moisture states

-

monthlyWB()

+
+

monthlyWB() monthlyWB_summary()

Monthly Water Balances

+
+

Moran_I_ByRaster()

+

Compute Moran's I for a raster sampled from a mapunit extent

multinominal2logical()

Convert Multinominal to Logical Matrix

+
+

OSDexamples

+

Example output from soilDB::fetchOSD()

PCP_plot()

Percentiles of Cumulative Precipitation

+

percentileDemo()

Demonstration of Percentiles vs. Mean / SD

+

plotAvailWater()

Visual Demonstration of Available Soil Water

+
+

plotGeomorphCrossSection()

+

Present a SoilProfileCollection aligned to a geomorphic summary as cross-section.

plotProfileDendrogram()

Plot soil profiles below a dendrogram

+

plotSoilRelationChordGraph()

Vizualize Soil Relationships via Chord Diagram.

+

Visualize Soil Relationships via Chord Diagram

plotSoilRelationGraph()

Plot a component relation graph

+

plotTransect()

Arrange Profiles along a Transect

+

plotWB()

Visualize Monthly Water Balance

+
+

plotWB_lines()

+

Line / Area Visualization for Monthly Water Balance

PLSS2LL()

PLSS2LL

+

polygonAdjacency()

Evaluate Spatial Adjacency of SpaitialPolygonsDataFrame Objects

+

Summarize Spatial Adjacency of Polygon Fabric

prepareDailyClimateData()

Prepare daily climate data (DAYMET) for a single point

+

prepare_SSURGO_hydro_data()

Get and prepare basic soil hydraulic parameters from SSURGO via SDA

+
+

reconcileOSDGeomorph()

+

Reconcile IDs between a SPC and associated geomorphic proportion table

sample.by.poly()

Sample a Polygon at Fixed Density

+

sampleRasterStackByMU()

Sample a Raster Stack

-

sharpshootR-package

+
+

samplingStability()

+

Estimate Sampling Stability

+

sharpshootR-package sharpshootR

A collection of functions to support soil survey

+

simpleWB()

Simple interface to the hydromad "leaky bucket" soil moisture model

+

site_photos_kml()

site_photos_kml

+

SoilTaxonomyDendrogram()

Soil Taxonomy Dendrogram

+

table5.2

Table 5.2 from Hole and Campbell, 1985.

+

vizAnnualClimate()

Annual Climate Summaries for Soil Series Data

+

vizFlatsPosition()

Visual Summary of Flat Landform Positions

+

vizGeomorphicComponent()

Visual Summary of Hill Landform Positions

+

vizHillslopePosition()

Visual Summary of Hillslope Position

+

vizMountainPosition()

Visual Summary of Mountain Slope Positions

+
+

vizSurfaceShape()

+

Visual Summary of Surface Shape

vizTerracePosition()

Visual Summary of Terraced Landform Positions

- +
+
-
- - + + diff --git a/docs/reference/isMineralSoilMaterial.html b/docs/reference/isMineralSoilMaterial.html index f8ac8f14..a656292e 100644 --- a/docs/reference/isMineralSoilMaterial.html +++ b/docs/reference/isMineralSoilMaterial.html @@ -1,67 +1,12 @@ - - - - - - - -Mineral Soil Material Criteria from 12th Ed. of KST — isMineralSoilMaterial • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Mineral Soil Material Criteria from 12th Ed. of KST — isMineralSoilMaterial • sharpshootR - + + - - - -
-
- -
- -
+
@@ -117,54 +52,52 @@

Mineral Soil Material Criteria from 12th Ed. of KST

Evaluate mineral soil material criteria based on soil organic carbon, clay content, and length of saturation.

-
isMineralSoilMaterial(soc, clay, saturation = TRUE)
- -

Arguments

- - - - - - - - - - - - - - -
soc

soil organic carbon percent by mass

clay

clay content percent by mass

saturation

logical, cumulative saturation 30+ days

- -

Value

- -

data.frame of criteria test results

+
+
isMineralSoilMaterial(soc, clay, saturation = TRUE)
+
+ +
+

Arguments

+
soc
+

soil organic carbon percent by mass

+ + +
clay
+

clay content percent by mass

+ + +
saturation
+

logical, cumulative saturation 30+ days

+ +
+
+

Value

+ + +

data.frame of criteria test results

+
+
- - - + + diff --git a/docs/reference/joinAdjacency.html b/docs/reference/joinAdjacency.html index 2f6b11e5..4d23a1a1 100644 --- a/docs/reference/joinAdjacency.html +++ b/docs/reference/joinAdjacency.html @@ -1,67 +1,12 @@ - - - - - - - -Join Document Adjacency — joinAdjacency • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Join Document Adjacency — joinAdjacency • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,56 +52,56 @@

Join Document Adjacency

Convert a set of line segment "join decisions" into a weighted adjacency matrix describing which map unit symbols touch.

-
joinAdjacency(x, vars = c("l_musym", "r_musym"))
+
+
joinAdjacency(x, vars = c("l_musym", "r_musym"))
+
-

Arguments

- - - - - - - - - - -
x

a SpatialLinesDataFrame object, with 1 line segment per feature (e.g. simple features)

vars

a vector of two characters naming columns containing "left", and "right" map unit symbols

+
+

Arguments

+
x
+

data.frame or similar object, each row represents a single shared edge (typically sf LINESTRING feature)

-

Value

-

A weighted adjacency matrix is returned, suitable for plotting directly with plotSoilRelationGraph.

-

Author

+
vars
+

a vector of two characters naming columns containing "left", and "right" map unit symbols

-

D.E. Beaudette

-

See also

+
+
+

Value

+ - +

A weighted adjacency matrix is returned, suitable for plotting directly with plotSoilRelationGraph().

+
+
+

See also

+ +
+
+

Author

+

D.E. Beaudette

+
+
- - - + + diff --git a/docs/reference/moistureStateProportions.html b/docs/reference/moistureStateProportions.html index 82ea94b5..9a790db8 100644 --- a/docs/reference/moistureStateProportions.html +++ b/docs/reference/moistureStateProportions.html @@ -1,67 +1,12 @@ - - - - - - - -Compute moisture state proportions — moistureStateProportions • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Compute moisture state proportions — moistureStateProportions • sharpshootR - - + + - - -
-
- -
- -
+
@@ -117,54 +52,54 @@

Compute moisture state proportions

Compute moisture state proportions

-
moistureStateProportions(x, id = "compname", step = c("month", "week", "doy"))
- -

Arguments

- - - - - - - - - - - - - - -
x

data.frame created by dailyWB() or dailyWB_SSURGO()

id

character, column name identifying sites, components, or soil series

step

time step, one of 'month', 'week', or 'doy'

- -

Value

- -

data.frame

+
+
moistureStateProportions(x, id = "compname", step = c("month", "week", "doy"))
+
+ +
+

Arguments

+
x
+

data.frame created by dailyWB() or dailyWB_SSURGO()

+ + +
id
+

character, column name identifying sites, components, or soil series

+ + +
step
+

time step, one of 'month', 'week', or 'doy'

+ +
+
+

Value

+ + +

data.frame

+ + +
+
- - - + + diff --git a/docs/reference/moistureStateThreshold.html b/docs/reference/moistureStateThreshold.html index 9075dcf8..fe9013ac 100644 --- a/docs/reference/moistureStateThreshold.html +++ b/docs/reference/moistureStateThreshold.html @@ -1,67 +1,12 @@ - - - - - - - -Apply a threshold to soil moisture states — moistureStateThreshold • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Apply a threshold to soil moisture states — moistureStateThreshold • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,66 +52,67 @@

Apply a threshold to soil moisture states

Apply a threshold to soil moisture states

-
moistureStateThreshold(
-  x,
-  id = "compname",
-  threshold = "moist",
-  operator = c("<", ">", "==", "<=", ">=")
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
x

a data.frame created by dailyWB() or dailyWB_SSURGO()

id

character, column name identifying sites, soils, or soil series

threshold

moisture state threshold, see estimateSoilMoistureState

operator

one of "<", ">", "==", "<=", or ">="

- -

Value

- -

data.frame

-

Author

+
+
moistureStateThreshold(
+  x,
+  id = "compname",
+  threshold = "moist",
+  operator = c("<", ">", "==", "<=", ">=")
+)
+
+ +
+

Arguments

+
x
+

a data.frame created by dailyWB() or dailyWB_SSURGO()

+ + +
id
+

character, column name identifying sites, soils, or soil series

+ +
threshold
+

moisture state threshold, see estimateSoilMoistureState

+ + +
operator
+

one of "<", ">", "==", "<=", or ">="

+ +
+
+

Value

+ + +

data.frame

+ + +
+
+

Author

D.E. Beaudette

+
+
- - - + + diff --git a/docs/reference/monthlyWB.html b/docs/reference/monthlyWB.html index f05cbccb..bba1d930 100644 --- a/docs/reference/monthlyWB.html +++ b/docs/reference/monthlyWB.html @@ -1,67 +1,12 @@ - - - - - - - -Monthly Water Balances — monthlyWB • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Monthly Water Balances — monthlyWB • sharpshootR - - + + - - -
-
- -
- -
+
-

Perform a monthly water balance by "leaky bucket" model, provided by the hydromad package.

+

Perform a monthly water balance by "leaky bucket" model, inspired by code from bucket.sim of hydromad package, as defined in Bai et al., (2009) (model "SMA_S1"). The plant available water-holding storage (soil thickness * awc) is used as the "bucket capacity". All water in excess of this capacity is lumped into a single "surplus" term.

-
monthlyWB(
-  AWC,
-  PPT,
-  PET,
-  S_init = AWC,
-  starting_month = 1,
-  rep = 1,
-  keep_last = FALSE,
-  fc = 1,
-  a.ss = 0.001
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AWC

available water-holding capacity (mm), typically thickness (mm) * awc

PPT

time-series of monthly PPT (mm), calendar year ordering

PET

time-series of monthly PET (mm), calendar year ordering

S_init

initial fraction of AWC filled with water

starting_month

starting month index, 1=January, 9=September

rep

number of cycles to run water balance

keep_last

keep only the last iteration of the water balance

fc

fraction of AWC representing field capacity (see details)

a.ss

recession coefficients for subsurface flow from saturated zone, should be > 0 but very small (see details)

- -

Value

- -

a data.frame with the following elements:

-
    -
  • PPT: monthly PPT values

  • -
  • PET: monthly PET values

  • -
  • U: monthly U values

  • -
  • S: monthly S values

  • -
  • ET: monthly ET values

  • -
  • D: monthly D values

  • -
  • month: month number

  • -
  • mo: month label

  • -
+
+
monthlyWB(
+  AWC,
+  PPT,
+  PET,
+  S_init = AWC,
+  starting_month = 1,
+  rep = 1,
+  keep_last = FALSE
+)
+
+monthlyWB_summary(w)
+
-

Details

+
+

Arguments

+
AWC
+

available water-holding capacity (mm), typically thickness (mm) * awc (fraction)

-

At a monthly time step, fc and a.ss have very little impact on results. See ?bucket.sim for details.

-

Note

-

This function depends on the hydromad package.

-

References

+
PPT
+

time-series of monthly PPT (mm), calendar year ordering

-

Farmer, D., M. Sivapalan, Farmer, D. (2003). Climate, soil and vegetation controls upon the variability of water balance in temperate and semiarid landscapes: downward approach to water balance analysis. Water Resources Research 39(2), p 1035.

-

Author

-

D.E. Beaudette

+
PET
+

time-series of monthly PET (mm), calendar year ordering

-

Examples

-
-if(requireNamespace('hydromad')) { -# 4" water storage ~ 100mm +
S_init
+

initial fraction of AWC filled with water

-# AWC in mm -AWC <- 200 -# monthly PET and PPT in mm -PET <- c(0,0,5,80,90,120,130,140,110,90,20,5) -PPT <- c(0, 150, 200, 120, 20, 0, 0, 0, 10, 20, 30, 60) +
starting_month
+

starting month index, 1=January, 9=September

-# run water balance -# start with soil AWC "empty" -(x.wb <- monthlyWB(AWC, PPT, PET, S_init = 0)) -# plot the results -par(mar=c(4,4,2,1), bg = 'white') -plotWB(WB = x.wb, AWC = AWC) +
rep
+

number of cycles to run water balance

-# compute fraction of AWC filled after the last month of simulation -(last.S <- x.wb$S[12] / AWC) -# re-run the water balance with this value -(x.wb <- monthlyWB(AWC, PPT, PET, S_init = last.S)) +
keep_last
+

keep only the last iteration of the water balance

-# not much difference -par(mar=c(4,4,2,1), bg = 'white') -plotWB(WB = x.wb, AWC = AWC) -} -
#> Loading required namespace: hydromad
-
+
w
+

used for for monthlyWB_summary(): a data.frame, such as result of monthlyWB();

+ +
+
+

Value

+ + +

a data.frame with the following elements:

+ + +
  • PPT: monthly PPT (mm)

  • +
  • PET: monthly PET (mm)

  • +
  • U: monthly surplus (mm)

  • +
  • S: monthly soil moisture storage (mm)

  • +
  • ET: monthly AET (mm)

  • +
  • D: monthly deficit (mm)

  • +
  • month: month number

  • +
  • mo: month label

  • +

monthlyWB_summary(): a data.frame containing:

  • cumulative (dry, moist, wet) days

  • +
  • consecutive (dry_con, moist_con, wet_con) days

  • +
  • total deficit (total_deficit) in mm

  • +
  • total surplus (total_surplus) in mm

  • +
  • total actual evapotranspiration (total_AET) in mm

  • +
  • annual actual evapotranspiration to potential evapotranspiration ratio (annual_AET_PET_ratio)

  • +
+
+

Details

+

See the monthly water balance tutorial for further examples and discussion.

+

A number of important assumptions are made by this style of water balance modeling:

  • the concept of field capacity is built into the specified bucket size

  • +
  • the influence of aquitards or local terrain cannot be integrated into this model

  • +
  • interception is not used in this model

  • +
+
+

References

+

Arkley R, Ulrich R. 1962. The use of calculated actual and potential evapotranspiration for estimating potential plant growth. Hilgardia 32(10):443-469.

+

Bai, Y., T. Wagener, P. Reed (2009). A top-down framework for watershed model evaluation and selection under uncertainty. Environmental Modelling and Software 24(8), pp. 901-916.

+

Farmer, D., M. Sivapalan, Farmer, D. (2003). Climate, soil and vegetation controls upon the variability of water balance in temperate and semiarid landscapes: downward approach to water balance analysis. Water Resources Research 39(2), p 1035.

+
+
+
-
- - + + diff --git a/docs/reference/multinominal2logical-1.png b/docs/reference/multinominal2logical-1.png index c8d7a6f9..44182ce3 100644 Binary files a/docs/reference/multinominal2logical-1.png and b/docs/reference/multinominal2logical-1.png differ diff --git a/docs/reference/multinominal2logical.html b/docs/reference/multinominal2logical.html index e4ea3428..b76edb56 100644 --- a/docs/reference/multinominal2logical.html +++ b/docs/reference/multinominal2logical.html @@ -1,67 +1,12 @@ - - - - - - - -Convert Multinominal to Logical Matrix — multinominal2logical • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Convert Multinominal to Logical Matrix — multinominal2logical • sharpshootR - - + + - - -
-
- -
- -
+
@@ -117,87 +52,90 @@

Convert Multinominal to Logical Matrix

Convert a single multinominal, site-level attribute from a SoilProfileCollection into a matrix of corresponding logical values. The result contains IDs from the SoilProfileCollection and can easily be joined to the original site-level data.

-
multinominal2logical(x, v)
+
+
multinominal2logical(x, v)
+
-

Arguments

- - - - - - - - - - -
x

a SoilProfileCollection object

v

the name of a site-level attribute that is a factor, or can be coerced to a factor, with more than 2 levels

+
+

Arguments

+
x
+

a SoilProfileCollection object

-

Value

-

A data.frame with IDs in the first column, and as many columns of logical vectors as there were levels in v. See examples.

-

See also

+
v
+

the name of a site-level attribute that is a factor, or can be coerced to a factor, with more than 2 levels

- -

Author

+
+
+

Value

+ +

A data.frame with IDs in the first column, and as many columns of logical vectors as there were levels in v. See examples.

+
+
+

See also

+ +
+
+

Author

D.E. Beaudette

+
-

Examples

-
-# \donttest{ - -if(require(soilDB) & - require(aqp) & - require(latticeExtra)) { - - - # sample data, an SPC - data(loafercreek, package='soilDB') - - # convert to logical matrix - hp <- multinominal2logical(loafercreek, 'hillslopeprof') - - # join-in to site data - site(loafercreek) <- hp - - # variable names - v <- c('lithic.contact', 'paralithic.contact', - 'argillic.horizon', 'toeslope', 'footslope', - 'backslope', 'shoulder', 'summit') - - # visualize with some other diagnostic features - x <- diagnosticPropertyPlot(loafercreek, v, k = 5, - grid.label = 'bedrckkind', dend.label = 'pedon_id') -} -
-# } - -
+
+

Examples

+

+# \donttest{
+
+if(require(soilDB) &
+   require(aqp) &
+   require(latticeExtra)) {
+  
+  
+  # sample data, an SPC
+  data(loafercreek, package='soilDB')
+  
+  # convert to logical matrix
+  hp <- multinominal2logical(loafercreek, 'hillslopeprof')
+  
+  # join-in to site data
+  site(loafercreek) <- hp
+  
+  # variable names
+  v <- c('lithic.contact', 'paralithic.contact', 
+         'argillic.horizon', 'toeslope', 'footslope', 
+         'backslope', 'shoulder', 'summit')
+  
+  # visualize with some other diagnostic features
+  x <- diagnosticPropertyPlot(loafercreek, v, k = 5, 
+                              grid.label = 'bedrckkind', dend.label = 'pedon_id')  
+}
+
+
+# }
+
+
+
+
- - - + + diff --git a/docs/reference/percentileDemo-1.png b/docs/reference/percentileDemo-1.png index 5cbab570..c4d04205 100644 Binary files a/docs/reference/percentileDemo-1.png and b/docs/reference/percentileDemo-1.png differ diff --git a/docs/reference/percentileDemo-2.png b/docs/reference/percentileDemo-2.png index 7e74223c..da0bbc3b 100644 Binary files a/docs/reference/percentileDemo-2.png and b/docs/reference/percentileDemo-2.png differ diff --git a/docs/reference/percentileDemo.html b/docs/reference/percentileDemo.html index 7a53c17d..2cff4cc4 100644 --- a/docs/reference/percentileDemo.html +++ b/docs/reference/percentileDemo.html @@ -1,67 +1,12 @@ - - - - - - - -Demonstration of Percentiles vs. Mean / SD — percentileDemo • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Demonstration of Percentiles vs. Mean / SD — percentileDemo • sharpshootR - - - - + + -
-
- -
- -
+
-
percentileDemo(x, labels.signif = 3, pctile.color = "RoyalBlue", 
-mean.color = "Orange", range.color = "DarkRed", 
-hist.breaks = 30, boxp = FALSE, ...)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

vector of values to summarize

labels.signif

integer, number of significant digits to be used in figure annotation

pctile.color

color used to demonstrate range from 10th to 90th percentiles

mean.color

color used to specify mean +/- 2SD

range.color

color used to specify data range

hist.breaks

integer, number of suggested breaks to hist

boxp

logical, add a box and whisker plot?

...

further arguments to plot

- -

Value

+
+
percentileDemo(x, labels.signif = 3, pctile.color = "RoyalBlue", 
+mean.color = "Orange", range.color = "DarkRed", 
+hist.breaks = 30, boxp = FALSE, ...)
+
-

A 1-row matrix of summary stats is invisibly returned.

-

References

+
+

Arguments

+
x
+

vector of values to summarize

-

https://ncss-tech.github.io/soil-range-in-characteristics/why-percentiles.html

-

Author

+
labels.signif
+

integer, number of significant digits to be used in figure annotation

-

D.E. Beaudette

-

Note

+
pctile.color
+

color used to demonstrate range from 10th to 90th percentiles

+ +
mean.color
+

color used to specify mean +/- 2SD

+ +
range.color
+

color used to specify data range

+ +
hist.breaks
+

integer, number of suggested breaks to hist

+
boxp
+

logical, add a box and whisker plot?

+ +
...
+

further arguments to plot

+ +
+
+

Value

+

A 1-row matrix of summary stats is invisibly returned.

+
+ +
+

Author

+

D.E. Beaudette

+
+
+

Note

This function is mainly for educational purposes.

+
-

Examples

-
x <- rnorm(100) -percentileDemo(x) -
-x <- rlnorm(100) -percentileDemo(x) -
+
+

Examples

+
x <- rnorm(100)
+percentileDemo(x)
+
+
+x <- rlnorm(100)
+percentileDemo(x)
+
+
+
+
-
- - + + diff --git a/docs/reference/plotAvailWater-1.png b/docs/reference/plotAvailWater-1.png index 5b6d5d5b..28bf73ac 100644 Binary files a/docs/reference/plotAvailWater-1.png and b/docs/reference/plotAvailWater-1.png differ diff --git a/docs/reference/plotAvailWater-2.png b/docs/reference/plotAvailWater-2.png index a5728dfc..d8e53040 100644 Binary files a/docs/reference/plotAvailWater-2.png and b/docs/reference/plotAvailWater-2.png differ diff --git a/docs/reference/plotAvailWater-3.png b/docs/reference/plotAvailWater-3.png index 79cdc0da..1c6c9a8a 100644 Binary files a/docs/reference/plotAvailWater-3.png and b/docs/reference/plotAvailWater-3.png differ diff --git a/docs/reference/plotAvailWater.html b/docs/reference/plotAvailWater.html index bfa45a16..e2a0de6b 100644 --- a/docs/reference/plotAvailWater.html +++ b/docs/reference/plotAvailWater.html @@ -1,67 +1,12 @@ - - - - - - - -Visual Demonstration of Available Soil Water — plotAvailWater • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Visual Demonstration of Available Soil Water — plotAvailWater • sharpshootR - - - - + + -
-
- -
- -
+
-

Generate a simplistic diagram of the various fractions of water held within soil pore-space. Largely inspired by Figure 2 from O'geen (2013).

+

Generate a simplistic diagram of the various fractions of water held within soil pore-space. Largely inspired by Figure 2 from O'Geen (2013).

-
plotAvailWater(
-  x,
-  width = 0.25,
-  cols = c(grey(0.5), "DarkGreen", "LightBlue", "RoyalBlue"),
-  name.cex = 0.8,
-  annotate = TRUE
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
x

a data.frame containing sample names and water retention data, see examples below

width

vertical width of each bar graph

cols

a vector of colors used to symbolize 'solid phase', 'unavailable water', 'available water', and 'gravitational water'

name.cex

character scaling of horizon names, printed on left-hand side of figure

annotate

logical, annotate AWC

- -

References

+
+
plotAvailWater(
+  x,
+  width = 0.25,
+  cols = c(grey(0.5), "DarkGreen", "LightBlue", "RoyalBlue"),
+  name.cex = 0.8,
+  annotate = TRUE
+)
+
-

O'Geen, A. T. (2013) Soil Water Dynamics. Nature Education Knowledge 4(5):9.

-

Author

+
+

Arguments

+
x
+

a data.frame containing sample names and water retention data, see examples below

-

D.E. Beaudette

-

Examples

-
+
width
+

vertical width of each bar graph

-# demonstration -s <- data.frame( - name = c('loamy sand', 'sandy loam', 'silt loam', 'clay loam'), - pwp = c(0.05, 0.1, 0.18, 0.2), - fc = c(0.1, 0.2, 0.38, 0.35), - sat = c(0.25, 0.3, 0.45, 0.4)) -s$solid <- with(s, 1-sat) -par(mar=c(5, 6, 0.5, 0.5)) -plotAvailWater(s, name.cex=1.25) -
+
cols
+

a vector of colors used to symbolize 'solid phase', 'unavailable water', 'available water', and 'gravitational water'

-# \donttest{ - - if(requireNamespace("aqp")) { - - # demonstration using idealized AWC by soil texture - data("ROSETTA.centroids", package = "aqp") - - # subset columns - x <- ROSETTA.centroids[, c('texture', 'pwp', 'fc', 'sat', 'awc')] - - # adjust to expected names / additional data required by plotAvailWater - names(x)[1] <- 'name' - x$solid <- with(x, 1 - sat) - - # re-order based on approximate AWC - x <- x[order(x$awc), ] - - par(mar=c(5, 6.5, 0.5, 0.5)) - plotAvailWater(x, name.cex=1) - - } -
- - # use some real data from SSURGO - if(requireNamespace("curl") & - curl::has_internet() & - require(soilDB)) { - - q <- "SELECT hzdept_r as hztop, hzdepb_r as hzbottom, -hzname as name, wsatiated_r/100.0 as sat, -wthirdbar_r/100.0 as fc, wfifteenbar_r/100.0 as pwp, awc_r as awc -FROM chorizon -WHERE cokey IN (SELECT cokey from component where compname = 'dunstone') -AND wsatiated_r IS NOT NULL -ORDER BY cokey, hzdept_r ASC;" - - x <- SDA_query(q) - x <- unique(x) - x <- x[order(x$name), ] - x$solid <- with(x, 1-sat) - - par(mar=c(5, 5, 0.5, 0.5)) - plotAvailWater(x) + +
name.cex
+

character scaling of horizon names, printed on left-hand side of figure

+ + +
annotate
+

logical, annotate AWC

+ +
+
+

Value

- } -
#> single result set, returning a data.frame
-# } -
+

nothing, function is called to generate graphical output

+
+
+

References

+

O'Geen, A. T. (2013) Soil Water Dynamics. Nature Education Knowledge 4(5):9.

+
+
+

Author

+

D.E. Beaudette

+
+ +
+

Examples

+

+
+# demonstration
+s <- data.frame(
+  name = c('loamy sand', 'sandy loam', 'silt loam', 'clay loam'), 
+  pwp = c(0.05, 0.1, 0.18, 0.2), 
+  fc = c(0.1, 0.2, 0.38, 0.35), 
+  sat = c(0.25, 0.3, 0.45, 0.4))
+s$solid <- with(s, 1-sat)
+
+par(mar=c(5, 6, 0.5, 0.5))
+plotAvailWater(s, name.cex=1.25)
+
+
+
+# \donttest{
+  
+  if(requireNamespace("aqp")) {
+    
+    # demonstration using idealized AWC by soil texture
+    data("ROSETTA.centroids", package = "aqp")
+    
+    # subset columns
+    x <- ROSETTA.centroids[, c('texture', 'pwp', 'fc', 'sat', 'awc')]
+    
+    # adjust to expected names / additional data required by plotAvailWater
+    names(x)[1] <- 'name'
+    x$solid <- with(x, 1 - sat)
+    
+    # re-order based on approximate AWC
+    x <- x[order(x$awc), ]
+    
+    op <- par(no.readonly = TRUE)
+    
+    par(mar=c(5, 6.5, 0.5, 0.5))
+    plotAvailWater(x, name.cex = 1)
+    
+    par(op)
+    
+  }
+
+  
+  
+  # use some real data from SSURGO
+  if(requireNamespace("curl") &
+     curl::has_internet() &
+     require(soilDB)) {
+    
+    q <- "SELECT hzdept_r as hztop, hzdepb_r as hzbottom, 
+hzname as name, wsatiated_r/100.0 as sat, 
+wthirdbar_r/100.0 as fc, wfifteenbar_r/100.0 as pwp, awc_r as awc
+FROM chorizon 
+WHERE cokey IN (SELECT cokey from component where compname = 'dunstone') 
+AND wsatiated_r IS NOT NULL 
+ORDER BY cokey, hzdept_r ASC;"
+    
+    x <- SDA_query(q)
+    x <- unique(x)
+    x <- x[order(x$name), ]
+    x$solid <- with(x, 1-sat)
+    
+    op <- par(no.readonly = TRUE)
+    
+    par(mar=c(5, 5, 0.5, 0.5))
+    plotAvailWater(x)
+    
+    par(op)
+  }
+#> single result set, returning a data.frame
+
+  
+# }
+
+
+
+
- - - + + diff --git a/docs/reference/plotProfileDendrogram.html b/docs/reference/plotProfileDendrogram.html index 4eef8d31..6e0f20b6 100644 --- a/docs/reference/plotProfileDendrogram.html +++ b/docs/reference/plotProfileDendrogram.html @@ -1,67 +1,12 @@ - - - - - - - -Plot soil profiles below a dendrogram — plotProfileDendrogram • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Plot soil profiles below a dendrogram — plotProfileDendrogram • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,93 +52,108 @@

Plot soil profiles below a dendrogram

Plot soil profiles below a dendrogram

-
plotProfileDendrogram(x, clust, scaling.factor=0.01, width=0.1, y.offset=0.1, 
-dend.y.scale= max(clust$height * 2, na.rm=TRUE) , 
-dend.color=par('fg'), dend.width=1, debug=FALSE, ...)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

a SoilProfileCollection object

clust

a hierachical clustering object generated by hclust(), cluster::agnes(), or cluster::diana()

scaling.factor

vertical scaling of the profile heights (may have to tinker with this)

width

scaling of profile widths

y.offset

vertical offset for top of profiles

dend.y.scale

extent of y-axis (may have to tinker with this)

dend.color

dendrogram line color

dend.width

dendrogram line width

debug

optionally print debugging data

...

additional arguments to plotSPC

- -

Details

+
+
plotProfileDendrogram(
+  x,
+  clust,
+  rotateToProfileID = FALSE,
+  scaling.factor = 0.01,
+  width = 0.1,
+  y.offset = 0.1,
+  dend.y.scale = max(clust$height * 2, na.rm = TRUE),
+  dend.color = par("fg"),
+  dend.width = 1,
+  debug = FALSE,
+  ...
+)
+
-

This function places soil profile sketches below a dendrogram.

-

Note

+
+

Arguments

+
x
+

a SoilProfileCollection object

-

You may have to tinker with some of the arguments to get optimal arrangement and scaling of soil profiles.

-

Author

-

D.E. Beaudette

-

See also

+
clust
+

a hierarchical clustering object generated by hclust, cluster::agnes, or cluster::diana

+ + +
rotateToProfileID
+

logical, attempt rotation of dendrogram according to original profile IDs, requires dendExtend package

+ + +
scaling.factor
+

vertical scaling of the profile heights (may have to tinker with this)

+ + +
width
+

scaling of profile widths

+ + +
y.offset
+

vertical offset for top of profiles

+ + +
dend.y.scale
+

extent of y-axis (may have to tinker with this)

+ + +
dend.color
+

dendrogram line color

+ + +
dend.width
+

dendrogram line width

- + +
debug
+

logical,optionally print debugging data

+ + +
...
+

additional arguments to plotSPC

+ +
+
+

Value

+ + +

a data.frame of IDs and linking structure

+
+
+

Details

+

This function places soil profile sketches below a dendrogram.

+
+
+

Note

+

You may have to tinker with some of the arguments to get optimal arrangement and scaling of soil profiles.

+
+
+

Author

+

D.E. Beaudette

+
+
- - - + + diff --git a/docs/reference/plotSoilRelationChordGraph.html b/docs/reference/plotSoilRelationChordGraph.html index 72d2b79b..67466472 100644 --- a/docs/reference/plotSoilRelationChordGraph.html +++ b/docs/reference/plotSoilRelationChordGraph.html @@ -1,67 +1,12 @@ - - - - - - - -Vizualize Soil Relationships via Chord Diagram. — plotSoilRelationChordGraph • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Visualize Soil Relationships via Chord Diagram — plotSoilRelationChordGraph • sharpshootR - - - - + + -
-
- -
- -
+
-

Plot a soil relationship diagram using a chord diagram.

+

Visualize Soil Relationships via Chord Diagram

-
plotSoilRelationChordGraph(m, s, mult = 2, base.color = "grey", 
-highlight.colors = c("RoyalBlue", "DarkOrange", "DarkGreen"), 
-add.legend = TRUE, ...)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
m

an adjacency matrix, no NA allowed

s

soil of interest, must exist in the column or row names of m

mult

multiplier used to re-scale data in m associated with s

base.color

color for all soils other than s and 1st and 2nd most commonly co-occuring

highlight.colors

vector of 3 colors: soil of interest, 1st most common, 2nd most common

add.legend

logical, add a legend

...

additional arguments passed to circlize::chordDiagramFromMatrix

- -

Details

- -

This function is experimental. Documentation pending. See http://jokergoo.github.io/circlize/ for ideas.

-

References

- -

https://github.com/jokergoo/circlize

-

Author

+
+
plotSoilRelationChordGraph(
+  m,
+  s,
+  mult = 2,
+  base.color = "grey",
+  highlight.colors = c("RoyalBlue", "DarkOrange", "DarkGreen"),
+  add.legend = TRUE,
+  ...
+)
+
+ +
+

Arguments

+
m
+

an adjacency matrix, no NA allowed

+ + +
s
+

soil of interest, must exist in the column or row names of m

+ + +
mult
+

multiplier used to re-scale data in m associated with s

+ + +
base.color
+

color for all soils other than s and 1st and 2nd most commonly co-occurring soils

-

D.E. Beaudette

-

See also

- +
highlight.colors
+

vector of 3 colors: soil of interest, 1st most common, 2nd most common

+ + +
add.legend
+

logical, add a legend

+ + +
...
+

additional arguments passed to circlize::chordDiagramFromMatrix

+ +
+
+

Value

+ + +

nothing, function is called to generate graphical output

+
+
+

Details

+

This function is experimental. Documentation pending. See http://jokergoo.github.io/circlize/ for ideas.

+
+
+

Author

+

D.E. Beaudette

+
-

Examples

-
# \donttest{ -data(amador) -m <- component.adj.matrix(amador) -plotSoilRelationChordGraph(m, 'amador') -
#> Loading required namespace: circlize
#> Note: The second link end is drawn out of sector 'pentz'.
# } -
+
-
- - + + diff --git a/docs/reference/plotSoilRelationGraph-1.png b/docs/reference/plotSoilRelationGraph-1.png index 16c12e39..a6af4397 100644 Binary files a/docs/reference/plotSoilRelationGraph-1.png and b/docs/reference/plotSoilRelationGraph-1.png differ diff --git a/docs/reference/plotSoilRelationGraph-2.png b/docs/reference/plotSoilRelationGraph-2.png index ec2ffa98..51df0839 100644 Binary files a/docs/reference/plotSoilRelationGraph-2.png and b/docs/reference/plotSoilRelationGraph-2.png differ diff --git a/docs/reference/plotSoilRelationGraph-3.png b/docs/reference/plotSoilRelationGraph-3.png index f61562d1..1ead77ae 100644 Binary files a/docs/reference/plotSoilRelationGraph-3.png and b/docs/reference/plotSoilRelationGraph-3.png differ diff --git a/docs/reference/plotSoilRelationGraph-4.png b/docs/reference/plotSoilRelationGraph-4.png index 7f6ef8b9..abe4536d 100644 Binary files a/docs/reference/plotSoilRelationGraph-4.png and b/docs/reference/plotSoilRelationGraph-4.png differ diff --git a/docs/reference/plotSoilRelationGraph-5.png b/docs/reference/plotSoilRelationGraph-5.png index ce9bd472..a94b16f8 100644 Binary files a/docs/reference/plotSoilRelationGraph-5.png and b/docs/reference/plotSoilRelationGraph-5.png differ diff --git a/docs/reference/plotSoilRelationGraph-6.png b/docs/reference/plotSoilRelationGraph-6.png index 6328dcab..6c44e036 100644 Binary files a/docs/reference/plotSoilRelationGraph-6.png and b/docs/reference/plotSoilRelationGraph-6.png differ diff --git a/docs/reference/plotSoilRelationGraph.html b/docs/reference/plotSoilRelationGraph.html index 292248a5..4d88aca4 100644 --- a/docs/reference/plotSoilRelationGraph.html +++ b/docs/reference/plotSoilRelationGraph.html @@ -1,67 +1,12 @@ - - - - - - - -Plot a component relation graph — plotSoilRelationGraph • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Plot a component relation graph — plotSoilRelationGraph • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,203 +52,212 @@

Plot a component relation graph

Plot a component relation graph based on an adjacency or similarity matrix.

-
plotSoilRelationGraph(
-  m,
-  s = "",
-  plot.style = c("network", "dendrogram"),
-  graph.mode = "upper",
-  spanning.tree = NULL,
-  del.edges = NULL,
-  vertex.scaling.method = "degree",
-  vertex.scaling.factor = 2,
-  edge.scaling.factor = 1,
-  vertex.alpha = 0.65,
-  edge.transparency = 1,
-  edge.col = grey(0.5),
-  edge.highlight.col = "royalblue",
-  g.layout = layout_with_fr,
-  vertex.label.color = "black",
-  delete.singletons = FALSE,
-  ...
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
m

adjacency matrix

s

central component; an empty character string is interpreted as no central component

plot.style

plot style ('network', or 'dendrogram'), or 'none' for no graphical output

graph.mode

interpretation of adjacency matrix: 'upper' or 'directed', see details

spanning.tree

plot the minimum or maximum spanning tree ('min', 'max'), or, max spanning tree plus edges with weight greater than the n-th quantile specified in spanning.tree. See details and examples.

del.edges

optionally delete edges with weights less than the specified quantile (0-1)

vertex.scaling.method

'degree' (default) or 'distance', see details

vertex.scaling.factor

scaling factor applied to vertex size

edge.scaling.factor

optional scaling factor applied to edge width

vertex.alpha

optional transparency setting for vertices (0-1)

edge.transparency

optional transparency setting for edges (0-1)

edge.col

edge color, applied to all edges

edge.highlight.col

edge color applied to all edges connecting to component named in s

g.layout

an igraph layout function, defaults to layout_with_fr

vertex.label.color

vertex label color

delete.singletons

optionally delete vertices with no edges (degree == 0)

...

further arguments passed to plotting function

- -

Value

- -

an igraph graph object is invisibly returned

-

Details

- -

Vertex size is based on a normalized index of connectivity:

    -
  • "degree" size = sqrt(degree(g)/max(degree(g))) * scaling.factor

  • -
  • "distance" size = sqrt(distance(V->s)/max(distance(V->s))) * scaling.factor, where distance(V->s) is the distance from all nodes to the named series, s.

  • -
- -

Edge width can be optionally scaled by edge weight by specifying an edge.scaling.factor value. The maximum spanning tree represents a sub-graph where the sum of edge weights are maximized. The minimum spanning tree represents a sub-graph where the sum of edge weights are minimized. The maximum spanning tree is likely a more useful simplification of the full graph, in which only the strongest relationships (e.g. most common co-occurrences) are preserved.

-

The maximum spanning tree + edges with weights > n-th quantile is an experimental hybrid. The 'backbone' of the graph is created by the maximum spanning tree, and augmented by 'strong' auxiliary edges--defined by a value between 0 and 1.

-

The graph.mode argument is passed to igraph::graph_from_adjacency_matrix() and determines how vertex relationships are coded in the adjacency matrix m. Typically, the default value of 'upper' (the upper triangle of m contains adjacency information) is the desired mode. If m contains directional information, set graph.mode to 'directed'. This has the side-effect of altering the default community detection algorithm from igraph::cluster_fast_greedy to igraph::cluster_walktrap.

-

Note

+
+
plotSoilRelationGraph(
+  m,
+  s = "",
+  plot.style = c("network", "dendrogram", "none"),
+  graph.mode = "upper",
+  spanning.tree = NULL,
+  del.edges = NULL,
+  vertex.scaling.method = "degree",
+  vertex.scaling.factor = 2,
+  edge.scaling.factor = 1,
+  vertex.alpha = 0.65,
+  edge.transparency = 1,
+  edge.col = grey(0.5),
+  edge.highlight.col = "royalblue",
+  g.layout = igraph::layout_with_fr,
+  vertex.label.color = "black",
+  delete.singletons = FALSE,
+  ...
+)
+
-

This function is a work in progress, ideas welcome.

-

Author

+
+

Arguments

+
m
+

adjacency matrix

-

D.E. Beaudette

-

Examples

-
-# load sample data set -data(amador) - -# create weighted adjacency matrix (see ?component.adj.matrix for details) -m <- component.adj.matrix(amador) - -# plot network diagram, with Amador soil highlighted -plotSoilRelationGraph(m, s='amador') -
-# dendrogram representation -plotSoilRelationGraph(m, s='amador', plot.style='dendrogram') -
-# compare methods -m.o <- component.adj.matrix(amador, method='occurrence') - -par(mfcol=c(1,2)) -plotSoilRelationGraph(m, s='amador', plot.style='dendrogram') -title('community matrix') -plotSoilRelationGraph(m.o, s='amador', plot.style='dendrogram') -
title('occurence') -
-# investigate max spanning tree -plotSoilRelationGraph(m, spanning.tree='max') - -# investigate max spanning tree + edges with weights > 75-th pctile -plotSoilRelationGraph(m, spanning.tree=0.75) -
-# \donttest{ - - if(requireNamespace("curl") & - curl::has_internet() & - require(soilDB)) { - - # get similar data from soilweb, for the Pardee series - s <- 'pardee' - d <- siblings(s, component.data = TRUE) - - # normalize component names - d$sib.data$compname <- tolower(d$sib.data$compname) - - # keep only major components - d$sib.data <- subset(d$sib.data, subset=compkind == 'Series') - - # build adj. matrix and plot - m <- component.adj.matrix(d$sib.data) - plotSoilRelationGraph(m, s=s, plot.style='dendrogram') - - # alter plotting style, see ?plot.phylo - plotSoilRelationGraph(m, s=s, plot.style='dendrogram', type='fan') - plotSoilRelationGraph(m, s=s, plot.style='dendrogram', type='unrooted', use.edge.length=FALSE) +
s
+

central component; an empty character string is interpreted as no central component

+ + +
plot.style
+

plot style ('network', or 'dendrogram'), or 'none' for no graphical output

+ + +
graph.mode
+

interpretation of adjacency matrix: 'upper' or 'directed', see details

+ + +
spanning.tree
+

plot the minimum or maximum spanning tree ('min', 'max'), or, max spanning tree plus edges with weight greater than the n-th quantile specified in spanning.tree. See details and examples.

+ + +
del.edges
+

optionally delete edges with weights less than the specified quantile (0-1)

+ + +
vertex.scaling.method
+

'degree' (default) or 'distance', see details

+ + +
vertex.scaling.factor
+

scaling factor applied to vertex size

+ + +
edge.scaling.factor
+

optional scaling factor applied to edge width

+ + +
vertex.alpha
+

optional transparency setting for vertices (0-1)

+ + +
edge.transparency
+

optional transparency setting for edges (0-1)

+ + +
edge.col
+

edge color, applied to all edges

+ + +
edge.highlight.col
+

edge color applied to all edges connecting to component named in s

+ + +
g.layout
+

an igraph layout function, defaults to igraph::layout_with_fr

+ + +
vertex.label.color
+

vertex label color

+ + +
delete.singletons
+

optionally delete vertices with no edges (degree == 0)

+ + +
...
+

further arguments passed to plotting function

+ +
+
+

Value

- } -
- -# } -
+

an igraph graph object is invisibly returned

+
+
+

Details

+

Vertex size is based on a normalized index of connectivity:

  • "degree" size = sqrt(igraph::degree(g) / max(igraph::degree(g))) * scaling.factor

  • +
  • "distance" size = sqrt(igraph::distance(V -> s) / max(igraph::distance(V -> s))) * scaling.factor, where distance(V->s) is the distance from all nodes to the named series, s.

  • +

Edge width can be optionally scaled by edge weight by specifying an edge.scaling.factor value. The maximum spanning tree represents a sub-graph where the sum of edge weights are maximized. The minimum spanning tree represents a sub-graph where the sum of edge weights are minimized. The maximum spanning tree is likely a more useful simplification of the full graph, in which only the strongest relationships (e.g. most common co-occurrences) are preserved.

+

The maximum spanning tree + edges with weights > n-th quantile is an experimental hybrid. The 'backbone' of the graph is created by the maximum spanning tree, and augmented by 'strong' auxiliary edges--defined by a value between 0 and 1.

+

The graph.mode argument is passed to igraph::graph_from_adjacency_matrix() and determines how vertex relationships are coded in the adjacency matrix m. Typically, the default value of 'upper' (the upper triangle of m contains adjacency information) is the desired mode. If m contains directional information, set graph.mode to 'directed'. This has the side-effect of altering the default community detection algorithm from igraph::cluster_fast_greedy to igraph::cluster_walktrap.

+
+
+

Note

+

This function is a work in progress, ideas welcome.

+
+
+

Author

+

D.E. Beaudette

+
+ +
+

Examples

+
if (requireNamespace("igraph")) {
+  # load sample data set
+  data(amador)
+
+  # create weighted adjacency matrix (see ?component.adj.matrix for details)
+  m <- component.adj.matrix(amador)
+
+  # plot network diagram, with Amador soil highlighted
+  plotSoilRelationGraph(m, s='amador')
+
+  # dendrogram representation
+  plotSoilRelationGraph(m, s='amador', plot.style='dendrogram')
+
+  # compare methods
+  m.o <- component.adj.matrix(amador, method='occurrence')
+
+  op <- par(no.readonly = TRUE)
+
+  par(mfcol=c(1,2))
+  plotSoilRelationGraph(m, s='amador', plot.style='dendrogram')
+  title('community matrix')
+  plotSoilRelationGraph(m.o, s='amador', plot.style='dendrogram')
+  title('occurence')
+
+  # investigate max spanning tree
+  plotSoilRelationGraph(m, spanning.tree='max')
+
+  # investigate max spanning tree + edges with weights > 75-th pctile
+  plotSoilRelationGraph(m, spanning.tree=0.75)
+
+  par(op)
+
+  # \donttest{
+  
+    if(requireNamespace("curl") &
+       curl::has_internet() &
+       require(soilDB)) {
+    
+      # get similar data from soilweb, for the Pardee series
+      s <- 'pardee'
+      d <- siblings(s, component.data = TRUE)
+    
+      # normalize component names
+      d$sib.data$compname <- tolower(d$sib.data$compname)
+    
+      # keep only major components
+      d$sib.data <- subset(d$sib.data, subset=compkind == 'Series')
+    
+      # build adj. matrix and plot
+      m <- component.adj.matrix(d$sib.data)
+      plotSoilRelationGraph(m, s=s, plot.style='dendrogram')
+    
+      # alter plotting style, see ?plot.phylo
+      plotSoilRelationGraph(m, s=s, plot.style='dendrogram', type='fan')
+      plotSoilRelationGraph(m, s=s, plot.style='dendrogram', type='unrooted', use.edge.length=FALSE) 
+    
+    }
+  # }
+}
+
+
+
+
+
+
+
+
+
+
- - - + + diff --git a/docs/reference/plotTransect-1.png b/docs/reference/plotTransect-1.png index e3c0037a..8d62cd30 100644 Binary files a/docs/reference/plotTransect-1.png and b/docs/reference/plotTransect-1.png differ diff --git a/docs/reference/plotTransect-2.png b/docs/reference/plotTransect-2.png index dcf4c766..8cdfa0f7 100644 Binary files a/docs/reference/plotTransect-2.png and b/docs/reference/plotTransect-2.png differ diff --git a/docs/reference/plotTransect-3.png b/docs/reference/plotTransect-3.png index 714481ef..1e14ef76 100644 Binary files a/docs/reference/plotTransect-3.png and b/docs/reference/plotTransect-3.png differ diff --git a/docs/reference/plotTransect-4.png b/docs/reference/plotTransect-4.png index 0fe3579d..22420cc2 100644 Binary files a/docs/reference/plotTransect-4.png and b/docs/reference/plotTransect-4.png differ diff --git a/docs/reference/plotTransect-5.png b/docs/reference/plotTransect-5.png index 246eac9a..80fbaf0a 100644 Binary files a/docs/reference/plotTransect-5.png and b/docs/reference/plotTransect-5.png differ diff --git a/docs/reference/plotTransect-6.png b/docs/reference/plotTransect-6.png index da42abe7..63c7cb15 100644 Binary files a/docs/reference/plotTransect-6.png and b/docs/reference/plotTransect-6.png differ diff --git a/docs/reference/plotTransect.html b/docs/reference/plotTransect.html index 24e6adff..4d4a075e 100644 --- a/docs/reference/plotTransect.html +++ b/docs/reference/plotTransect.html @@ -1,67 +1,12 @@ - - - - - - - -Arrange Profiles along a Transect — plotTransect • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Arrange Profiles along a Transect — plotTransect • sharpshootR - - + + - - -
-
- -
- -
+
@@ -117,191 +52,214 @@

Arrange Profiles along a Transect

Plot a collection of Soil Profiles linked to their position along some gradient (e.g. transect).

-
plotTransect(
-  s,
-  grad.var.name,
-  grad.var.order = order(site(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,
-  dist.scaling.factor = 1000,
-  spacing = c("regular", "relative"),
-  fix.relative.pos = list(thresh = 0.6, maxIter = 5000),
-  ...
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
s

SoilProfileCollection object

grad.var.name

the name of a site-level attribute containing gradient values

grad.var.order

optional indexing vector used to override sorting along grad.var.name

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 applied to profile sketches

distance.axis.title

a title for the along-transect distances

crs

an optional CRS object (sp package) used to convert coordinates into a projected coordinate reference system

grad.axis.title

a title for the gradient axis

dist.scaling.factor

scaling factor (divisor) applied to linear distance units, default is conversion from m to km (1000)

spacing

profile sketch spacing style: "regular" (profiles aligned to an integer grid) or "re -lative" (relative distance along transect)

fix.relative.pos

adjust relative positions in the presence of overlap, FALSE to suppress, otherwise list of arguments to aqp::fixOverlap

...

further arguments passed to aqp::plotSPC.

- -

Value

- -

An invisibly-returned data.frame object:

    -
  • scaled.grad: scaled gradient values

  • +
    +
    plotTransect(
    +  s,
    +  xy,
    +  grad.var.name,
    +  grad.var.order = order(site(s)[[grad.var.name]]),
    +  transect.col = "RoyalBlue",
    +  tick.number = 7,
    +  y.offset = 100,
    +  scaling.factor = 0.5,
    +  distance.axis.title = "Distance Along Transect (km)",
    +  grad.axis.title = NULL,
    +  dist.scaling.factor = 1000,
    +  spacing = c("regular", "relative"),
    +  fix.relative.pos = list(thresh = 0.6, maxIter = 5000),
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    s
    +

    SoilProfileCollection object

    + + +
    xy
    +

    sf object, defining point coordinates of soil profiles, must be in same order as s, must be a projected coordinate reference system (UTM, AEA, etc.)

    + + +
    grad.var.name
    +

    the name of a site-level attribute containing gradient values

    + + +
    grad.var.order
    +

    optional indexing vector used to override sorting along grad.var.name

    + + +
    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 applied to profile sketches

    + + +
    distance.axis.title
    +

    a title for the along-transect distances

    + + +
    grad.axis.title
    +

    a title for the gradient axis

    + + +
    dist.scaling.factor
    +

    scaling factor (divisor) applied to linear distance units, default is conversion from m to km (1000)

    + + +
    spacing
    +

    profile sketch spacing style: "regular" (profiles aligned to an integer grid) or "relative" (relative distance along transect)

    + + +
    fix.relative.pos
    +

    adjust relative positions in the presence of overlap, FALSE to suppress, otherwise list of arguments to aqp::fixOverlap

    + + +
    ...
    +

    further arguments passed to aqp::plotSPC.

    + +
    +
    +

    Value

    + + +

    An invisibly-returned data.frame object:

    • scaled.grad: scaled gradient values

    • scaled.distance: cumulative distance, scaled to the interval of 0.5, nrow(coords) + 0.5

    • distance: cumulative distance computed along gradient, e.g. transect distance

    • variable: sorted gradient values

    • x: x coordinates, ordered by gradient values

    • y: y coordinate, ordered by gradient values

    • grad.order: a vector index describing the sort order defined by gradient values

    • -
    - -

    Details

    - +
+
+

Details

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.

-

Note

- +
+
+

Note

This function is very much a work in progress, ideas welcome!

-

Author

- +
+
+

Author

D.E. Beaudette

+
-

Examples

-
-# \donttest{ - -if(require(aqp) & -require(sp) & - require(soilDB) -) { - - # sample data - data("mineralKing", package = "soilDB") - - # quick overview - par(mar=c(1,1,2,1)) - groupedProfilePlot(mineralKing, groups='taxonname', print.id=FALSE) - - # init coords and CRS - coordinates(mineralKing) <- ~ x_std + y_std - proj4string(mineralKing) <- '+proj=longlat +datum=NAD83' - - # projected CRS, units of meters - crs.utm <- CRS('+proj=utm +zone=11 +datum=NAD83') - - # adjust margins - par(mar=c(4.5,4,4,1)) - - # standard transect plot, profile sketches arranged along integer sequence - plotTransect(mineralKing, grad.var.name='elev_field', crs=crs.utm, - grad.axis.title='Elevation (m)', label='pedon_id', name='hzname') - - # default behavior, attempt adjustments to prevent over-plot and preserve relative spacing - # use set.seed() to fix outcome - plotTransect(mineralKing, grad.var.name='elev_field', crs=crs.utm, - grad.axis.title='Elevation (m)', label='pedon_id', - name='hzname', width=0.15, spacing = 'relative') - - # attempt relative positioning based on scaled distances, no corrections for overlap - # profiles are clustered in space and therefore over-plot - plotTransect(mineralKing, grad.var.name='elev_field', crs=crs.utm, - grad.axis.title='Elevation (m)', label='pedon_id', name='hzname', - width=0.15, spacing = 'relative', fix.relative.pos = FALSE) - - # customize arguments to aqp::fixOverlap() - plotTransect(mineralKing, grad.var.name='elev_field', crs=crs.utm, - grad.axis.title='Elevation (m)', label='pedon_id', name='hzname', - width=0.15, spacing = 'relative', - fix.relative.pos = list(maxIter=6000, adj=0.2, thresh=0.7)) - - plotTransect(mineralKing, grad.var.name='elev_field', crs=crs.utm, - grad.axis.title='Elevation (m)', label='pedon_id', name='hzname', - width=0.2, spacing = 'relative', - fix.relative.pos = list(maxIter=6000, adj=0.2, thresh=0.6), - name.style = 'center-center') - -} -
#> Loading required package: sp
#> Warning: package 'sp' was built under R version 4.0.3
#> 689 iterations
#> 1073 iterations
#> 760 iterations
# } - - -
+
+

Examples

+

+# \donttest{
+
+if(require(aqp) & 
+require(sf) &
+  require(soilDB)
+) {
+   
+library(aqp)
+library(soilDB)
+library(sf)
+
+
+# sample data
+data("mineralKing", package = "soilDB")
+
+# device options are modified locally, reset when done
+op <- par(no.readonly = TRUE)
+
+# quick overview
+par(mar=c(1,1,2,1))
+groupedProfilePlot(mineralKing, groups='taxonname', print.id=FALSE)
+
+# setup point locations
+s <- site(mineralKing)
+xy <- st_as_sf(s, coords = c('x_std', 'y_std'))
+st_crs(xy) <- 4326
+
+# convert to suitable projected cRS
+# projected CRS, UTM z11 NAD83 (https://epsg.io/26911)
+xy <- st_transform(xy, 26911) 
+
+# adjust margins
+par(mar = c(4.5, 4, 4, 1))
+
+# standard transect plot, profile sketches arranged along integer sequence
+plotTransect(mineralKing, xy, grad.var.name = 'elev_field',
+             grad.axis.title = 'Elevation (m)', label = 'pedon_id', name = 'hzname')
+
+# default behavior, attempt adjustments to prevent over-plot and preserve relative spacing
+# use set.seed() to fix outcome
+plotTransect(mineralKing, xy, grad.var.name = 'elev_field',
+             grad.axis.title = 'Elevation (m)', label = 'pedon_id',
+             name = 'hzname', width = 0.15, spacing = 'relative')
+
+# attempt relative positioning based on scaled distances, no corrections for overlap
+# profiles are clustered in space and therefore over-plot
+plotTransect(mineralKing, xy, grad.var.name = 'elev_field',
+             grad.axis.title = 'Elevation (m)', label = 'pedon_id', name = 'hzname',
+             width = 0.15, spacing = 'relative', fix.relative.pos = FALSE)
+
+# customize arguments to aqp::fixOverlap()
+plotTransect(mineralKing, xy, grad.var.name = 'elev_field', crs = crs.utm,
+             grad.axis.title = 'Elevation (m)', label = 'pedon_id', name = 'hzname',
+             width = 0.15, spacing = 'relative',
+             fix.relative.pos = list(maxIter=6000, adj=0.2, thresh=0.7))
+
+plotTransect(mineralKing, xy, grad.var.name = 'elev_field', crs = crs.utm,
+             grad.axis.title = 'Elevation (m)', label = 'pedon_id', name = 'hzname',
+             width = 0.2, spacing = 'relative',
+             fix.relative.pos = list(maxIter = 6000, adj = 0.2, thresh = 0.6),
+             name.style = 'center-center')
+
+par(op)
+  
+}
+#> Loading required package: sf
+#> Warning: package 'sf' was built under R version 4.2.2
+#> Linking to GEOS 3.9.3, GDAL 3.5.2, PROJ 8.2.1; sf_use_s2() is TRUE
+
+#> 689 iterations
+
+
+#> 1073 iterations
+
+#> 760 iterations
+
+
+# }
+
+
+
+
+
- - - + + diff --git a/docs/reference/plotWB-1.png b/docs/reference/plotWB-1.png index a76d579c..878349e3 100644 Binary files a/docs/reference/plotWB-1.png and b/docs/reference/plotWB-1.png differ diff --git a/docs/reference/plotWB-2.png b/docs/reference/plotWB-2.png index 353f04fd..606b4ec5 100644 Binary files a/docs/reference/plotWB-2.png and b/docs/reference/plotWB-2.png differ diff --git a/docs/reference/plotWB-3.png b/docs/reference/plotWB-3.png index bdda991f..bc346d6b 100644 Binary files a/docs/reference/plotWB-3.png and b/docs/reference/plotWB-3.png differ diff --git a/docs/reference/plotWB.html b/docs/reference/plotWB.html index 1363d566..7b762726 100644 --- a/docs/reference/plotWB.html +++ b/docs/reference/plotWB.html @@ -1,67 +1,16 @@ - - - - - - +Visualize Monthly Water Balance — plotWB • sharpshootR - - + + - - -
-
- -
- -
+
-

This function offers one possible visualization for the results of monthlyWB.

+

This function offers one possible visualization for the results of monthlyWB(). Note that "surplus" water is stacked on top of "actual ET", and "deficit" water is stacked below "storage". Calculate actual values for "surplus" and "deficit" from the figure like this:

  • surplus value = surplus - AET

  • +
  • deficit value = deficit - storage

  • +
+ +
+
plotWB(
+  WB,
+  AWC = attr(WB, "AWC"),
+  sw.col = "#377EB8",
+  surplus.col = "#4DAF4A",
+  et.col = "#E41A1C",
+  deficit.col = "#FF7F00",
+  pch = c(21, 21),
+  pt.cex = 1,
+  pt.col = par("bg"),
+  pt.bg = par("fg"),
+  lty = c(1, 2),
+  lwd = 2,
+  n.ticks = 8,
+  grid.col = grey(0.65),
+  month.cex = 1,
+  legend.cex = 0.9,
+  ylim
+)
-
plotWB(
-  WB,
-  AWC,
-  showAWC = "below",
-  sw.col = "#377EB8",
-  surplus.col = "#4DAF4A",
-  et.col = "#E41A1C",
-  deficit.col = "#FF7F00",
-  pch = c("P", "E"),
-  pt.cex = 0.85,
-  lwd = 2,
-  n.ticks = 8,
-  grid.col = grey(0.65),
-  month.cex = 1
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WB

output from monthlyWB

AWC

available water-holding capacity (mm)

showAWC

styling to show box for AWC below (default) or above zero point of axis

sw.col

color for soil water

surplus.col

color for surplus water

et.col

color for ET

deficit.col

color for deficit

pch

plotting character for PPT and PET points (c('P', 'E'))

pt.cex

character expansion factor for PPT and PET points

lwd

line width for PPT and PET curves

n.ticks

approximate number of tick marks on positive and negative y-axis

grid.col

horizontal grid line color

month.cex

character expansion factor for month labels (x-axis)

- -

Note

+
+

Arguments

+
WB
+

output from monthlyWB()

-

You may have to adjust figure margins and size to get all of the elements to "look right".

-

Author

-

D.E. Beaudette and J.M. Skovlin

+
AWC
+

available water-holding capacity (mm), typically the value used in monthlyWB() and stored as an attribute of WB

+ + +
sw.col
+

color for soil water ("storage)

-

Examples

-
-if(requireNamespace('hydromad')) { -## 100mm (4") AWC -# monthly PPT and PET extracted from monthly estimates at Sonora, CA -AWC <- 100 -PPT <- c(171, 151, 138, 71, 36, 7, 1, 2, 11, 48, 102, 145) -PET <- c(15.17, 18.26, 30.57, 42.95, 75.37, 108.05, 139.74, 128.9, 93.99, 59.84, 26.95, 14.2) +
surplus.col
+

color for surplus water

-# water-year -# three years -x.wb <- monthlyWB(AWC, PPT, PET, S_init = 0, starting_month = 9, rep = 3) -x.wb[x.wb$mo == 'Sep', ] -# new-style representation, with AWC "above 0" -plotWB(x.wb, AWC, showAWC = 'below') +
et.col
+

color for ET

-# old-style representation, with AWC "above 0" -plotWB(x.wb, AWC, showAWC = 'above') +
deficit.col
+

color for deficit

-# water year -# last iteration -x.wb <- monthlyWB(AWC, PPT, PET, S_init = 0, - starting_month = 9, rep = 3, - keep_last = TRUE -) -plotWB(x.wb, AWC) +
pch
+

plotting character for PPT and PET points

-} -
-
+ +
pt.cex
+

character expansion factor for PPT and PET points

+ + +
pt.col
+

point symbol color for PPT and PET points

+ + +
pt.bg
+

point symbol background color for PPT and PET points

+ + +
lty
+

line type for PPT and PET lines (c(1, 2))

+ + +
lwd
+

line width for PPT and PET curves

+ + +
n.ticks
+

approximate number of tick marks on positive and negative y-axis

+ + +
grid.col
+

horizontal grid line color

+ + +
month.cex
+

scaling factor for month labels (x-axis)

+ + +
legend.cex
+

scaling factor for legend

+ + +
ylim
+

optional vector of y-axis limits, c(-min, max), typically used when comparing drastically different water balances in the same figure. Default limits are usually best for a single water balance plot.

+ +
+
+

Value

+ + +

nothing, function is called to generate graphical output

+
+
+

Note

+

You may have to adjust figure margins and size to get all of the elements to "look right".

+
+
+

Author

+

D.E. Beaudette and J.M. Skovlin

+
+ +
+

Examples

+

+if(requireNamespace('hydromad')) {
+
+## A shallow / droughty soil near Sonora CA 
+# 100mm (4") AWC
+AWC <- 100
+PPT <- c(171, 151, 138, 71, 36, 7, 1, 2, 11, 48, 102, 145)
+PET <- c(15.17, 18.26, 30.57, 42.95, 75.37, 108.05, 139.74, 128.9, 93.99, 59.84, 26.95, 14.2)
+
+# water-year
+# three years
+x.wb <- monthlyWB(AWC, PPT, PET, S_init = 0, starting_month = 9, rep = 3)
+x.wb[x.wb$mo == 'Sep', ]
+
+# plot all three years
+plotWB(x.wb)
+
+# water-year / last iteration
+x.wb <- monthlyWB(AWC, PPT, PET, S_init = 0, 
+                  starting_month = 9, rep = 3, 
+                  keep_last = TRUE
+)
+
+# plot
+plotWB(x.wb)
+
+
+## Drummer series (Fine-silty, mixed, superactive, mesic Typic Endoaquolls), southern IL
+
+AWC <- 244
+PPT <- c(36, 37, 54, 82, 98, 96, 92, 75, 69, 70, 65, 50)
+PET <- c(0, 0, 12, 46, 90, 130, 145, 128, 88, 46, 14, 0)
+
+# using calendar year
+x.wb <- monthlyWB(AWC, PPT, PET, S_init = 0,
+                  starting_month = 1, rep = 3,
+                  keep_last = TRUE
+)
+
+plotWB(x.wb)
+
+}
+#> Loading required namespace: hydromad
+
+
+
+
+
+
+
-
- - + + diff --git a/docs/reference/polygonAdjacency.html b/docs/reference/polygonAdjacency.html index b71d5781..1541b294 100644 --- a/docs/reference/polygonAdjacency.html +++ b/docs/reference/polygonAdjacency.html @@ -1,67 +1,12 @@ - - - - - - - -Evaluate Spatial Adjacency of SpaitialPolygonsDataFrame Objects — polygonAdjacency • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Summarize Spatial Adjacency of Polygon Fabric — polygonAdjacency • sharpshootR - - - - + + -
-
- -
- -
+
-

This function utilizes the `spdep` and `igraph` packages to evaluate several measures of spatial connectivity.

+

This function utilizes the spdep and igraph packages to evaluate several measures of spatial connectivity.

-
polygonAdjacency(x, v='MUSYM', ...)
- -

Arguments

- - - - - - - - - - - - - - -
x

a SpatialPolygonsDataFrame object

v

name of the field in the attribute table to use when searching for `common lines`, see details

...

additional arguments passed to spdep::poly2nb

- -

Details

- -

Examples are presented in this tutorial.

-

Value

- -

A list object containing:

-
commonLines

An integer vector of feature IDs, that share a common boundary and attribute v.commonLines. Sometimes referred to as "common soil lines".

-
adjMat

A weighted adjacency matrix

- -
+
+
polygonAdjacency(x, v = "MUSYM", ...)
+
-

Author

+
+

Arguments

+
x
+

sf object containing simple polygon features, some of which should share edges

+ +
v
+

character, name of column in attribute table describing map unit labels

+ + +
...
+

additional arguments passed to spdep::poly2nb()

+ +
+
+

Value

+ + +

a list containing:

  • commonLines: an integer vector of feature IDs, describing polygons sharing edges and values of v (map unit labels)

  • +
  • adjMat: weighted adjacency matrix, suitable for visualization with plotSoilRelationGraph()

  • +
+
+

Details

+

Examples are presented in this tutorial.

+
+
+

Author

D.E. Beaudette

+
+
-
- - + + diff --git a/docs/reference/prepareDailyClimateData.html b/docs/reference/prepareDailyClimateData.html index b0b24073..48cb4937 100644 --- a/docs/reference/prepareDailyClimateData.html +++ b/docs/reference/prepareDailyClimateData.html @@ -1,72 +1,17 @@ - - - - - - - -Prepare daily climate data (DAYMET) for a single point — prepareDailyClimateData • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Prepare daily climate data (DAYMET) for a single point — prepareDailyClimateData • sharpshootR - - - - - - - - - - - + + - - -
-
- -
- -
+
-

This function returns daily climate data required for a simple water balance (and more), using three packages:

    -
  • elevatr: elevation data at x

  • +

    This function returns daily climate data required for a simple water balance (and more), using three packages:

    • elevatr: elevation data at x

    • daymetr: DAYMET data at x for years start through end

    • Evapotranspiration: Makkink formulation for estimating reference crop evapotranspiration

    • -
    +
+
+
prepareDailyClimateData(x, start, end, onlyWB = TRUE)
-
prepareDailyClimateData(x, start, end, onlyWB = TRUE)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
x

SpatialPoints object representing a single location

start

start year (1998)

end

end year (2018)

onlyWB

logical, return just those date required by dailyWB

- -

Value

- -

a data.frame

+
+

Arguments

+
x
+

sf object representing a single point

+ + +
start
+

start year (1998)

+ + +
end
+

end year (2018)

+ + +
onlyWB
+

logical, return just those date required by dailyWB

+ +
+
+

Value

+ + +

a data.frame

+ + +
+
-
- - + + diff --git a/docs/reference/prepare_SSURGO_hydro_data.html b/docs/reference/prepare_SSURGO_hydro_data.html index 9224817e..4466afa5 100644 --- a/docs/reference/prepare_SSURGO_hydro_data.html +++ b/docs/reference/prepare_SSURGO_hydro_data.html @@ -1,67 +1,12 @@ - - - - - - - -Get and prepare basic soil hydraulic parameters from SSURGO via SDA — prepare_SSURGO_hydro_data • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Get and prepare basic soil hydraulic parameters from SSURGO via SDA — prepare_SSURGO_hydro_data • sharpshootR - - + + - - -
-
- -
- -
+
@@ -117,57 +52,57 @@

Get and prepare basic soil hydraulic parameters from SSURGO via SDA

Get and prepare basic soil hydraulic parameters from SSURGO via SDA

-
prepare_SSURGO_hydro_data(cokeys, max.depth)
+
+
prepare_SSURGO_hydro_data(cokeys, max.depth)
+
-

Arguments

- - - - - - - - - - -
cokeys

vector of component keys (cokey) in current SSURGO snapshot

max.depth

target depth of aggregation, corrected later by real soil depth as reported by slab()

+
+

Arguments

+
cokeys
+

vector of component keys (cokey) in current SSURGO snapshot

-

Value

-

a list containing:

    -
  • SPC: SoilProfileCollection

  • -
  • agg: aggregate representation of hydraulic parameters

  • -
+
max.depth
+

target depth of aggregation (cm), corrected later by real soil depth as reported by slab()

-

Author

+
+
+

Value

+ +

a list containing:

  • SPC: SoilProfileCollection

  • +
  • agg: aggregate representation of hydraulic parameters, by cokey

  • +
+
+

Details

+

Weighted mean soil hydraulic parameters are returned over the interval of 0-max.depth, calculated by aqp::slab().

+
+
+

Author

D.E. Beaudette

+
+
- - - + + diff --git a/docs/reference/sample.by.poly.html b/docs/reference/sample.by.poly.html index 1b87c238..3b95adcb 100644 --- a/docs/reference/sample.by.poly.html +++ b/docs/reference/sample.by.poly.html @@ -1,67 +1,12 @@ - - - - - - - -Sample a Polygon at Fixed Density — sample.by.poly • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Sample a Polygon at Fixed Density — sample.by.poly • sharpshootR - - - - + + -
-
- -
- -
+
-
sample.by.poly(p, n.pts.per.ac=1, min.samples=5, 
-sampling.type='regular', iterations=10, p4s=NULL)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
p

a Polygon object, with coordinates in a projected CRS with units of meters

n.pts.per.ac

requested sampling density in points per acre (results will be close)

min.samples

minimum requested number of samples per polygon

sampling.type

sampling type, see spsample

iterations

number of tries that spsample will attempt

p4s

a qualified proj4string that will be assigned to sampling points

- -

Details

- -

This function is typically accessed via some kind of helper function such as constantDensitySampling.

-

Value

+
+
sample.by.poly(p, n.pts.per.ac=1, min.samples=5, 
+sampling.type='regular', p4s=NULL)
+
-

A SpatialPoints object.

-

Author

+
+

Arguments

+
p
+

a Polygon object, with coordinates in a projected CRS with units of meters

-

D.E. Beaudette

-

Note

+
n.pts.per.ac
+

requested sampling density in points per acre (results will be close)

-

This function expects that the Polygon object has coordinates associated with a projected CRS-- e.g. units of meters. Invalid geometries may cause errors or yield incorrect sample sizes.

-

See also

+
min.samples
+

minimum requested number of samples per polygon

+ +
sampling.type
+

sampling type

- +
p4s
+

a qualified proj4string that will be assigned to sampling points

+ +
+
+

Details

+

This function is typically accessed via some kind of helper function such as constantDensitySampling.

+
+
+

Value

+

A SpatialPoints object.

+
+
+

Author

+

D.E. Beaudette

+
+
+

Note

+

This function expects that the Polygon object has coordinates associated with a projected CRS-- e.g. units of meters. Invalid geometries may cause errors or yield incorrect sample sizes.

+
+
+

See also

+ +
+
-
- - + + diff --git a/docs/reference/sampleRasterStackByMU.html b/docs/reference/sampleRasterStackByMU.html index 47b20fe8..9f2d8f35 100644 --- a/docs/reference/sampleRasterStackByMU.html +++ b/docs/reference/sampleRasterStackByMU.html @@ -1,67 +1,12 @@ - - - - - - - -Sample a Raster Stack — sampleRasterStackByMU • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Sample a Raster Stack — sampleRasterStackByMU • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,99 +52,113 @@

Sample a Raster Stack

Sample a raster stack by map unit polygons, at a constant density.

-
sampleRasterStackByMU(mu, mu.set, mu.col, raster.list, pts.per.acre, 
-p = c(0, 0.05, 0.25, 0.5, 0.75, 0.95, 1), progress = TRUE,
-estimateEffectiveSampleSize=TRUE, polygon.id='pID')
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
mu

a SpatialPolygonsDataFrame object in a projected coordinate reference system (CRS)

mu.set

character vector of map unit labels to be sampled

mu.col

column name in attribute table containing map unit labels

raster.list

a list containing raster names and paths, see details below

pts.per.acre

target sampling density in `points per acre`

p

percentiles for polygon area stats, e.g. (0.05, 0.25, 0.5, 0.75, 0.95)

progress

logical, print a progress bar while sampling?

estimateEffectiveSampleSize

estimate an effective sample size via Moran's I?

polygon.id

Column name containing unique polygon IDs; default: 'pID'; calculated if missing

- -

Details

- -

This function is used by various NRCS reports that summarize or compare concepts defined by collections of polygons using raster data sampled from within each polygon, at a constant sampling density. Even though the function name includes "rasterSTack", this function doesn't actually operate on a `stack` object as defined in the raster package. The collection of raster data defined in raster.list do not have to share a common coordinate reference system, grid spacing, or extent. Point samples generated from mu are automatically converted to the CRS of each raster before extracting values. The extent of each raster in raster.list must completely contain the extent of mu.

-

Value

- -

A list containing:

-
-
`raster.samples`

a data.frame containing samples from all rasters in the stack

-
`area.stats`

a data.frame containing area statistics for all map units in the collection

-
`unsampled.ids`

an index to rows in the original SPDF associated with polygons not sampled

-
`raster.summary`

a data.frame containing information on sampled rasters

-
`Moran_I`

a data.frame containing estimates Moran's I (index of spatial autocorrelation)

- -
- - -

Author

+
+
sampleRasterStackByMU(
+  mu,
+  mu.set,
+  mu.col,
+  raster.list,
+  pts.per.acre,
+  p = c(0, 0.05, 0.25, 0.5, 0.75, 0.95, 1),
+  progress = TRUE,
+  estimateEffectiveSampleSize = TRUE,
+  polygon.id = "pID"
+)
+
+ +
+

Arguments

+
mu
+

a SpatialPolygonsDataFrame object in a projected coordinate reference system (CRS)

+ + +
mu.set
+

character vector of map unit labels to be sampled

+ + +
mu.col
+

column name in attribute table containing map unit labels

+ + +
raster.list
+

a list containing raster names and paths, see details below

+ + +
pts.per.acre
+

target sampling density in points per acre

+ + +
p
+

percentiles for polygon area stats, e.g. c(0.05, 0.25, 0.5, 0.75, 0.95)

+ + +
progress
+

logical, print a progress bar while sampling?

+ + +
estimateEffectiveSampleSize
+

estimate an effective sample size via Moran's I?

-

D.E. Beaudette

-

See also

- +
polygon.id
+

Column name containing unique polygon IDs; default: "pID"; calculated if missing

+ +
+
+

Value

+ + +

A list containing:

raster.samples
+

a data.frame containing samples from all rasters in the stack

+ +
area.stats
+

a data.frame containing area statistics for all map units in the collection

+ +
unsampled.ids
+

an index to rows in the original SPDF associated with polygons not sampled

+ +
raster.summary
+

a data.frame containing information on sampled rasters

+ +
Moran_I
+

a data.frame containing estimates Moran's I (index of spatial autocorrelation)

+ + +
+
+

Details

+

This function is used by various NRCS reports that summarize or compare concepts defined by collections of polygons using raster data sampled from within each polygon, at a constant sampling density. Even though the function name includes "RasterStack", this function doesn't actually operate on the "stack" object as defined in the raster package. The collection of raster data defined in raster.list do not have to share a common coordinate reference system, grid spacing, or extent. Point samples generated from mu are automatically converted to the CRS of each raster before extracting values. The extent of each raster in raster.list must completely contain the extent of mu.

+
+ +
+

Author

+

D.E. Beaudette

+
+
- - - + + diff --git a/docs/reference/sharpshootR-package.html b/docs/reference/sharpshootR-package.html index 2c65f375..7c06ca7d 100644 --- a/docs/reference/sharpshootR-package.html +++ b/docs/reference/sharpshootR-package.html @@ -1,67 +1,12 @@ - - - - - - - -A collection of functions to support soil survey — sharpshootR-package • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -A collection of functions to support soil survey — sharpshootR-package • sharpshootR - - - - + + -
-
- -
- -
+
-

This package contains mish-mash of functionality and sample data related to the daily business of soil survey operations with the USDA-NRCS. Many of the functions are highly specialized and inherit default arguments from the names used by the various NCSS (National Cooperative Soil Survey) databases. A detailed description of this package with links to associated tutorials can be found at the project website.

+

This package contains mish-mash of functionality and sample data related to the daily business of soil survey operations with the USDA-NRCS. Many of the functions are highly specialized and inherit default arguments from the names used by the various NCSS (National Cooperative Soil Survey) databases. A detailed description of this package with links to associated tutorials can be found at the project website.

-
+
-
- - + + diff --git a/docs/reference/simpleWB.html b/docs/reference/simpleWB.html index 7ab4d8ae..2939d04d 100644 --- a/docs/reference/simpleWB.html +++ b/docs/reference/simpleWB.html @@ -1,67 +1,12 @@ - - - - - - - -Simple interface to the hydromad "leaky bucket" soil moisture model — simpleWB • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple interface to the hydromad "leaky bucket" soil moisture model — simpleWB • sharpshootR + + - - - - -
-
- -
- -
+
@@ -117,81 +52,107 @@

Simple interface to the hydromad "leaky bucket" soil moisture model

Simple interface to the hydromad "leaky bucket" soil moisture model.

-
simpleWB(PPT, PET, D, thickness, sat, fc, S_0 = 0.5, a.ss = 0.05)
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PPT

precipitation series (mm)

PET

potential ET series (mm)

D

dates

thickness

soil thickness (cm)

sat

volumeric water content at saturation (satiated water content)

fc

volumetric water content at field capacity (typically 1/3 bar suction)

S_0

initial soil moisture as a fraction of total water storage (mm)

a.ss

recession coefficients for subsurface flow from saturated zone, should be > 0

- -

Value

- -

a data.frame

-

Details

+
+
simpleWB(
+  PPT,
+  PET,
+  D,
+  thickness,
+  sat,
+  fc,
+  pwp,
+  S_0 = 0.5,
+  a.ss = 0.05,
+  M = 0,
+  etmult = 1
+)
+
-

Adjustments for coarse fragments should be made by reducing thickness.

-

References

+
+

Arguments

+
PPT
+

precipitation series (mm)

+ +
PET
+

potential ET series (mm)

+ + +
D
+

dates

+ + +
thickness
+

soil thickness (cm)

+ + +
sat
+

volumetric water content at saturation (satiated water content)

+ + +
fc
+

volumetric water content at field capacity (typically 1/3 bar suction)

+ + +
pwp
+

volumetric water content at permanent wilting point (typically 15 bar suction)

+ + +
S_0
+

initial soil moisture as a fraction of total water storage (mm)

+ + +
a.ss
+

recession coefficients for subsurface flow from saturated zone, should be > 0

+ + +
M
+

fraction of area covered by deep-rooted vegetation

+ + +
etmult
+

multiplier for PET

+ +
+
+

Value

+ + +

a data.frame

+ + +
+
+

Details

+

Adjustments for coarse fragments should be made by reducing thickness.

+
+
+

References

Farmer, D., M. Sivapalan, Farmer, D. (2003). Climate, soil and vegetation controls upon the variability of water balance in temperate and semiarid landscapes: downward approach to water balance analysis. Water Resources Research 39(2), p 1035.

Bai, Y., T. Wagener, P. Reed (2009). A top-down framework for watershed model evaluation and selection under uncertainty. Environmental Modelling and Software 24(8), pp. 901-916.

+
+
- - - + + diff --git a/docs/reference/site_photos_kml.html b/docs/reference/site_photos_kml.html index 348fd118..35163898 100644 --- a/docs/reference/site_photos_kml.html +++ b/docs/reference/site_photos_kml.html @@ -1,67 +1,12 @@ - - - - - - - -site_photos_kml — site_photos_kml • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -site_photos_kml — site_photos_kml • sharpshootR - - - - + + -
-
- -
- -
+
-
site_photos_kml(data, 
-filename='photos.kml', make.image.grid=FALSE, 
-file.source = c('local', 'relative')
-)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
data

a dataframe

filename

full file path and name with .kml extension

make.image.grid

logical, include linked site images, default is FALSE

file.source

'local' sources the image files to a specific system path, 'relative' sources the image files to files folder that can be included and referenced within a .kmz file

- -

Details

- -

This function simplifies writing a kml file of site and/or sites with linked photos. Further documentation is provided in this tutorial.

-

Value

+
+
site_photos_kml(data, 
+filename='photos.kml', make.image.grid=FALSE, 
+file.source = c('local', 'relative')
+)
+
-

A KML file of of sites with embedded associated site photos.

-

Author

+
+

Arguments

+
data
+

a dataframe

+ +
filename
+

full file path and name with .kml extension

+ +
make.image.grid
+

logical, include linked site images, default is FALSE

+
file.source
+

'local' sources the image files to a specific system path, 'relative' sources the image files to files folder that can be included and referenced within a .kmz file

+ +
+
+

Details

+

This function simplifies writing a kml file of site and/or sites with linked photos. Further documentation is provided in this tutorial.

+
+
+

Value

+

A KML file of of sites with embedded associated site photos.

+
+
+

Author

Jay Skovlin, D.E. Beaudette

+
+
-
- - + + diff --git a/docs/reference/table5.2-1.png b/docs/reference/table5.2-1.png index baaea26f..57871509 100644 Binary files a/docs/reference/table5.2-1.png and b/docs/reference/table5.2-1.png differ diff --git a/docs/reference/table5.2-2.png b/docs/reference/table5.2-2.png index 3c9d526b..b2fc80b0 100644 Binary files a/docs/reference/table5.2-2.png and b/docs/reference/table5.2-2.png differ diff --git a/docs/reference/table5.2-3.png b/docs/reference/table5.2-3.png index d80c7706..f94b7e40 100644 Binary files a/docs/reference/table5.2-3.png and b/docs/reference/table5.2-3.png differ diff --git a/docs/reference/table5.2.html b/docs/reference/table5.2.html index dad00f82..e3ffd0b6 100644 --- a/docs/reference/table5.2.html +++ b/docs/reference/table5.2.html @@ -1,67 +1,12 @@ - - - - - - - -Table 5.2 from Hole and Campbell, 1985. — table5.2 • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Table 5.2 from Hole and Campbell, 1985. — table5.2 • sharpshootR - - - - + + -
-
- -
- -
+
@@ -117,63 +52,70 @@

Table 5.2 from Hole and Campbell, 1985.

An adjacency matrix describing shared soil map boundary segments from the Soil Survey of Shawnee county, KS. This is table 5.2 from Hole and Campbell, 1985.

-
data(table5.2)
- - -

Format

+
+
data(table5.2)
+
+
+

Format

An object of class matrix (inherits from array) with 18 rows and 18 columns.

-

References

- +
+
+

References

Hole, F.D. and J.B. Campbell. Soil Landscape Analysis. Rowman and Allanheld, 1985.

+
-

Examples

-
-data("table5.2") - -if(requireNamespace("igraph")) { - - # note special incantation to get the "correct" graph structure - g <- igraph::graph_from_adjacency_matrix(table5.2, mode = 'upper', diag = FALSE, weighted = TRUE) - - # visualize - par(mar = c(0,0,0,0)) - plot(g) - - plot(g, vertex.size = sqrt(igraph::degree(g) * 25), vertex.label.family = 'sans') - - # find communities - cm <- igraph::cluster_walktrap(g) - plot(cm, g, vertex.label.family = 'sans') - -} -
-
+
+

Examples

+

+data("table5.2")
+
+if(requireNamespace("igraph")) {
+  
+  # note special incantation to get the "correct" graph structure
+  g <- igraph::graph_from_adjacency_matrix(table5.2, mode = 'upper', diag = FALSE, weighted = TRUE)
+  
+  # visualize
+  op <- par(no.readonly = TRUE)
+  
+  par(mar = c(0,0,0,0))
+  plot(g)
+  
+  plot(g, vertex.size = sqrt(igraph::degree(g) * 25), vertex.label.family = 'sans')
+  
+  # find communities
+  cm <- igraph::cluster_walktrap(g)
+  plot(cm, g, vertex.label.family = 'sans')
+  
+  par(op)
+}
+
+
+
+
+
+
+
- - - + + diff --git a/docs/reference/vizAnnualClimate.html b/docs/reference/vizAnnualClimate.html index dc30beb7..3e83fc5a 100644 --- a/docs/reference/vizAnnualClimate.html +++ b/docs/reference/vizAnnualClimate.html @@ -1,67 +1,12 @@ - - - - - - - -Annual Climate Summaries for Soil Series Data — vizAnnualClimate • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Annual Climate Summaries for Soil Series Data — vizAnnualClimate • sharpshootR - - - - + + -
-
- -
- -
+
-

Annual climate summaries for soil series, based on latticeExtra::segplot, based on 5th, 25th, 50th, 75th, and 95th percentiles. Input data should be from soilDB::fetchOSD.

+

Annual climate summaries for soil series, based on latticeExtra::segplot, based on 5th, 25th, 50th, 75th, and 95th percentiles. Input data should be from soilDB::fetchOSD.

-
vizAnnualClimate(climate.data, IQR.cex = 1, s = NULL, s.col = "firebrick", ...)
+
+
vizAnnualClimate(climate.data, IQR.cex = 1, s = NULL, s.col = "firebrick", ...)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
climate.data

Annual climate summaries, as returned from soilDB::fetchOSD(..., extended=TRUE)

IQR.cex

scaling factor for bar representing interquartile range

s

a soil series name, e.g. "LUCY", to highlight

s.col

color for highlighted soil series

...

further arguments passed to latticeExtra::segplot

+
+

Arguments

+
climate.data
+

Annual climate summaries, as returned from soilDB::fetchOSD(..., extended=TRUE)

-

Value

-

A list with the following elements:

    -
  • fig: lattice object (the figure)

  • -
  • clust: clustering object returned by cluster::diana

  • -
+
IQR.cex
+

scaling factor for bar representing interquartile range

-

Details

-

This function was designed for use with soilDB::fetchOSD. It might be possible to use with other sources of data but your mileage may vary.

-

See also

+
s
+

a soil series name, e.g. "LUCY", to highlight

-

vizHillslopePosition

-

Author

-

D.E. Beaudette

+
s.col
+

color for highlighted soil series

-

Examples

-
-if(requireNamespace("curl") & -curl::has_internet() & - require(soilDB) & - require(aqp) & - require(latticeExtra) -) { - - # soil series of interest - soil <- 'ARBUCKLE' - - # get competing series - sdata <- fetchOSD(soil, extended = TRUE) - - # get competing series' data - sdata.competing <- fetchOSD(c(soil, sdata$competing$competing)) - - # only use established series - idx <- which(sdata.competing$series_status == 'established') - - # subset as needed - if(length(idx) < length(sdata.competing)) { - sdata.competing <- sdata.competing[idx, ] + +
...
+

further arguments passed to latticeExtra::segplot

+ +
+
+

Value

- } - - # now get the extended data - sdata.competing.full <- fetchOSD(site(sdata.competing)$id, extended = TRUE) - - # extract SPC - spc <- sdata.competing.full$SPC - - # full set of series names - s.names <- unique(site(spc)$id) - - # todo: probably better ways to do this... - # note: need to load lattice for this to work - trellis.par.set(plot.line=list(col='RoyalBlue')) - - # control center symbol and size here - res <- vizAnnualClimate( - sdata.competing.full$climate.annual, - s = soil, - IQR.cex = 1.1, - cex = 1.1, - pch = 18 - ) - - # plot figure - print(res$fig) - - # check clustering - str(res$clust) - - # do something with clustering - par(mar=c(0,0,1,1)) - plotProfileDendrogram(spc, clust = res$clust, scaling.factor = 0.075, width = 0.2, y.offset = 0.5) - mtext('sorted by annual climate summaries', side = 3, at = 0.5, adj = 0, line = -1.5, font=3) - -} -
#> List of 7 -#> $ order : int [1:16] 1 3 7 5 4 2 6 12 8 14 ... -#> $ height : num [1:15] 1.977 0 0.944 1.977 3.311 ... -#> $ dc : num 0.846 -#> $ merge : int [1:15, 1:2] -3 -8 2 -6 1 3 5 -1 -9 4 ... -#> $ diss : 'dissimilarity' Named num [1:120] 2.05 1.43 1.53 1.78 3.34 ... -#> ..- attr(*, "Labels")= chr [1:16] "ARBUCKLE" "BLASINGAME" "BOGA" "CLEARHAYES" ... -#> ..- attr(*, "Size")= int 16 -#> ..- attr(*, "Metric")= chr "euclidean" -#> $ call : language diana(x = daisy(climate.data.wide[, -1], stand = TRUE)) -#> $ order.lab: chr [1:16] "ARBUCKLE" "BOGA" "LOEMSTONE" "CREVISCREEK" ... -#> - attr(*, "class")= chr [1:2] "diana" "twins"
-
+ +

A list with the following elements:

  • fig: lattice object (the figure)

  • +
  • clust: clustering object returned by cluster::diana

  • +
+
+

Details

+

This function was designed for use with soilDB::fetchOSD. It might be possible to use with other sources of data but your mileage may vary. See the Soil Series Query Functions tutorial for more information.

+
+
+

See also

+

vizHillslopePosition

+
+
+

Author

+

D.E. Beaudette

+
+
+
- - - + + diff --git a/docs/reference/vizFlatsPosition.html b/docs/reference/vizFlatsPosition.html index 500045d7..80be184c 100644 --- a/docs/reference/vizFlatsPosition.html +++ b/docs/reference/vizFlatsPosition.html @@ -1,67 +1,12 @@ - - - - - - - -Visual Summary of Flat Landform Positions — vizFlatsPosition • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Visual Summary of Flat Landform Positions — vizFlatsPosition • sharpshootR - - + + - - -
-
- -
- -
+
@@ -117,67 +52,82 @@

Visual Summary of Flat Landform Positions

A unique display of landform position probability.

-
vizFlatsPosition(x, s = NULL, annotations = TRUE, annotation.cex = 0.75)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
x

data.frame as created by soilDB::fetchOSD(..., extended=TRUE), see details

s

an optional soil series name, highlighted in the figure

annotations

logical, add number of record and normalized Shannon entropy values

annotation.cex

annotation label scaling factor

- -

Value

- -

a list with the following elements:

-
fig

lattice object (the figure)

-
order

ordering of soil series

- -

Details

- -

See the Soil Series Query Functions tutorial for more information.

-

Author

+
+
vizFlatsPosition(
+  x,
+  s = NULL,
+  annotations = TRUE,
+  annotation.cex = 0.75,
+  cols = c("#2B83BA", "#ABDDA4", "#FFFFBF", "#FDAE61", "#D7191C"),
+  ...
+)
+
+ +
+

Arguments

+
x
+

data.frame as created by soilDB::fetchOSD(..., extended=TRUE), see details

+ + +
s
+

an optional soil series name, highlighted in the figure

+ + +
annotations
+

logical, add number of record and normalized Shannon entropy values

+ +
annotation.cex
+

annotation label scaling factor

+ + +
cols
+

vector of colors

+ + +
...
+

additional arguments to [iterateHydOrder]: target = 0.9, maxIter = 20, j.amount = 0.05, verbose = FALSE

+ +
+
+

Value

+ + +

A list with the following elements:

  • fig: lattice object (the figure)

  • +
  • order: 1D ordering from cluster::diana

  • +
  • clust: hclust object

  • +
  • match.rate: fraction of series matching target hydrologic ordering, after clustering + rotation

  • +
+
+

Details

+

See the Soil Series Query Functions tutorial for more information.

+
+
+

Author

D.E. Beaudette

+
+
- - - + + diff --git a/docs/reference/vizGeomorphicComponent.html b/docs/reference/vizGeomorphicComponent.html index 05726d15..ff5ea262 100644 --- a/docs/reference/vizGeomorphicComponent.html +++ b/docs/reference/vizGeomorphicComponent.html @@ -1,67 +1,12 @@ - - - - - - - -Visual Summary of Hill Landform Positions — vizGeomorphicComponent • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Visual Summary of Hill Landform Positions — vizGeomorphicComponent • sharpshootR - - + + - - -
-
- -
- -
+
@@ -117,67 +52,82 @@

Visual Summary of Hill Landform Positions

A unique display of landform position probability.

-
vizGeomorphicComponent(x, s = NULL, annotations = TRUE, annotation.cex = 0.75)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
x

data.frame as created by soilDB::fetchOSD(..., extended=TRUE), see details

s

an optional soil series name, highlighted in the figure

annotations

logical, add number of record and normalized Shannon entropy values

annotation.cex

annotation label scaling factor

- -

Value

- -

a list with the following elements:

-
fig

lattice object (the figure)

-
order

ordering of soil series

- -

Details

- -

See the Soil Series Query Functions tutorial for more information.

-

Author

+
+
vizGeomorphicComponent(
+  x,
+  s = NULL,
+  annotations = TRUE,
+  annotation.cex = 0.75,
+  cols = c("#D53E4F", "#FC8D59", "#FEE08B", "#E6F598", "#99D594", "#3288BD"),
+  ...
+)
+
+ +
+

Arguments

+
x
+

data.frame as created by soilDB::fetchOSD(..., extended=TRUE), see details

+ + +
s
+

an optional soil series name, highlighted in the figure

+ + +
annotations
+

logical, add number of record and normalized Shannon entropy values

+ +
annotation.cex
+

annotation label scaling factor

+ + +
cols
+

vector of colors

+ + +
...
+

additional arguments to [iterateHydOrder]: target = 0.9, maxIter = 20, j.amount = 0.05, verbose = FALSE

+ +
+
+

Value

+ + +

A list with the following elements:

  • fig: lattice object (the figure)

  • +
  • order: 1D ordering from cluster::diana

  • +
  • clust: hclust object

  • +
  • match.rate: fraction of series matching target hydrologic ordering, after clustering + rotation

  • +
+
+

Details

+

See the Soil Series Query Functions tutorial for more information.

+
+
+

Author

D.E. Beaudette

+
+
- - - + + diff --git a/docs/reference/vizHillslopePosition.html b/docs/reference/vizHillslopePosition.html index 5b61166c..22964a5e 100644 --- a/docs/reference/vizHillslopePosition.html +++ b/docs/reference/vizHillslopePosition.html @@ -1,67 +1,12 @@ - - - - - - - -Visual Summary of Hillslope Position — vizHillslopePosition • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Visual Summary of Hillslope Position — vizHillslopePosition • sharpshootR + + - - - - -
-
- -
- -
+
@@ -117,89 +52,82 @@

Visual Summary of Hillslope Position

A unique display of hillslope position probability.

-
vizHillslopePosition(x, s = NULL, annotations = TRUE, annotation.cex = 0.75)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
x

data.frame as created by soilDB::fetchOSD(..., extended=TRUE), see details

s

an optional soil series name, highlighted in the figure

annotations

logical, add number of record and normalized Shannon entropy values

annotation.cex

annotation label scaling factor

- -

Value

- -

a list with the following elements:

-
fig

lattice object (the figure)

-
order

ordering of soil series

- -

Details

- -

See the Soil Series Query Functions tutorial for more information.

-

Author

+
+
vizHillslopePosition(
+  x,
+  s = NULL,
+  annotations = TRUE,
+  annotation.cex = 0.75,
+  cols = c("#2B83BA", "#ABDDA4", "#FFFFBF", "#FDAE61", "#D7191C"),
+  ...
+)
+
-

D.E. Beaudette

+
+

Arguments

+
x
+

data.frame as created by soilDB::fetchOSD(..., extended = TRUE)

+ + +
s
+

an optional soil series name, highlighted in the figure

+ + +
annotations
+

logical, add number of record and normalized Shannon entropy values

-

Examples

-
-# \donttest{ -if(requireNamespace("curl") & - curl::has_internet() & - require(aqp) & - require(soilDB)) { - - # soils of interest - s.list <- c('musick', 'cecil', 'drummer', 'amador', 'pentz', 'reiff', - 'san joaquin','montpellier','grangeville','pollasky','ramona') - - # fetch and convert data into an SPC - s <- fetchOSD(s.list, extended=TRUE) - - res <- vizHillslopePosition(s$hillpos) - print(res$fig) - -} -
# } -
+
annotation.cex
+

annotation label scaling factor

+ + +
cols
+

vector of colors

+ + +
...
+

additional arguments to [iterateHydOrder]: target = 0.9, maxIter = 20, j.amount = 0.05, verbose = FALSE

+ +
+
+

Value

+ + +

A list with the following elements:

  • fig: lattice object (the figure)

  • +
  • order: 1D ordering from cluster::diana

  • +
  • clust: hclust object

  • +
  • match.rate: fraction of series matching target hydrologic ordering, after clustering + rotation

  • +
+
+

Details

+

See the Soil Series Query Functions tutorial for more information.

+
+
+

Author

+

D.E. Beaudette

+
+
+
- - - + + diff --git a/docs/reference/vizMountainPosition.html b/docs/reference/vizMountainPosition.html index 5f73ff68..5ed4ad36 100644 --- a/docs/reference/vizMountainPosition.html +++ b/docs/reference/vizMountainPosition.html @@ -1,67 +1,12 @@ - - - - - - - -Visual Summary of Mountain Slope Positions — vizMountainPosition • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Visual Summary of Mountain Slope Positions — vizMountainPosition • sharpshootR - - + + - - -
-
- -
- -
+
@@ -117,67 +52,82 @@

Visual Summary of Mountain Slope Positions

A unique display of mountain slope position probability.

-
vizMountainPosition(x, s = NULL, annotations = TRUE, annotation.cex = 0.75)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
x

data.frame as created by soilDB::fetchOSD(..., extended=TRUE), see details

s

an optional soil series name, highlighted in the figure

annotations

logical, add number of record and normalized Shannon entropy values

annotation.cex

annotation label scaling factor

- -

Value

- -

a list with the following elements:

-
fig

lattice object (the figure)

-
order

ordering of soil series

- -

Details

- -

See the Soil Series Query Functions tutorial for more information.

-

Author

+
+
vizMountainPosition(
+  x,
+  s = NULL,
+  annotations = TRUE,
+  annotation.cex = 0.75,
+  cols = c("#D53E4F", "#FC8D59", "#FEE08B", "#E6F598", "#99D594", "#3288BD"),
+  ...
+)
+
+ +
+

Arguments

+
x
+

data.frame as created by soilDB::fetchOSD(..., extended=TRUE), see details

+ + +
s
+

an optional soil series name, highlighted in the figure

+ + +
annotations
+

logical, add number of record and normalized Shannon entropy values

+ +
annotation.cex
+

annotation label scaling factor

+ + +
cols
+

vector of colors

+ + +
...
+

additional arguments to [iterateHydOrder]: target = 0.9, maxIter = 20, j.amount = 0.05, verbose = FALSE

+ +
+
+

Value

+ + +

A list with the following elements:

  • fig: lattice object (the figure)

  • +
  • order: 1D ordering from cluster::diana

  • +
  • clust: hclust object

  • +
  • match.rate: fraction of series matching target hydrologic ordering, after clustering + rotation

  • +
+
+

Details

+

See the Soil Series Query Functions tutorial for more information.

+
+
+

Author

D.E. Beaudette

+
+
- - - + + diff --git a/docs/reference/vizTerracePosition.html b/docs/reference/vizTerracePosition.html index 77c6953a..ef0a5ce0 100644 --- a/docs/reference/vizTerracePosition.html +++ b/docs/reference/vizTerracePosition.html @@ -1,67 +1,12 @@ - - - - - - - -Visual Summary of Terraced Landform Positions — vizTerracePosition • sharpshootR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Visual Summary of Terraced Landform Positions — vizTerracePosition • sharpshootR - - + + - - -
-
- -
- -
+
@@ -117,67 +52,82 @@

Visual Summary of Terraced Landform Positions

A unique display of terraced landform position probability.

-
vizTerracePosition(x, s = NULL, annotations = TRUE, annotation.cex = 0.75)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
x

data.frame as created by soilDB::fetchOSD(..., extended=TRUE), see details

s

an optional soil series name, highlighted in the figure

annotations

logical, add number of record and normalized Shannon entropy values

annotation.cex

annotation label scaling factor

- -

Value

- -

a list with the following elements:

-
fig

lattice object (the figure)

-
order

ordering of soil series

- -

Details

- -

See the Soil Series Query Functions tutorial for more information.

-

Author

+
+
vizTerracePosition(
+  x,
+  s = NULL,
+  annotations = TRUE,
+  annotation.cex = 0.75,
+  cols = c("#2B83BA", "#FDAE61"),
+  ...
+)
+
+ +
+

Arguments

+
x
+

data.frame as created by soilDB::fetchOSD(..., extended=TRUE), see details

+ + +
s
+

an optional soil series name, highlighted in the figure

+ + +
annotations
+

logical, add number of record and normalized Shannon entropy values

+ +
annotation.cex
+

annotation label scaling factor

+ + +
cols
+

vector of colors

+ + +
...
+

additional arguments to [iterateHydOrder]: target = 0.9, maxIter = 20, j.amount = 0.05, verbose = FALSE

+ +
+
+

Value

+ + +

A list with the following elements:

  • fig: lattice object (the figure)

  • +
  • order: 1D ordering from cluster::diana

  • +
  • clust: hclust object

  • +
  • match.rate: fraction of series matching target hydrologic ordering, after clustering + rotation

  • +
+
+

Details

+

See the Soil Series Query Functions tutorial for more information.

+
+
+

Author

D.E. Beaudette

+
+
- - - + +