Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
159 lines (127 sloc) 4.48 KB
---
layout : post_en
title : 'Gallery of texture triangles'
---
<!-- DO NOT EDIT THE .md file. Edit the .Rmd file instead -->
Last update: `r format( Sys.time(), "%Y-%m-%d" )`
This page presents a gallery of texture triangles, as generated
with my R package [soiltexture][].
```{r general-options, echo=FALSE, message=FALSE}
if( Sys.info()[[ "sysname" ]] == "Linux" ){
setwd( wd <- "/home/jules/Documents/julienmoeys.info/julienmoeys.github.io" )
}else{
setwd( wd <- "D:/Users/julienm/Documents/_WORKS/_WEB/julienmoeys.github.io" )
}
library( "soiltexture" )
```
```{r generate-triangle-plots, echo=FALSE}
# List of texture triangles
triangleList <- c(
"HYPRES.TT", "USDA.TT", "FR.AISNE.TT", "FR.GEPPA.TT",
"DE.BK94.TT", "UK.SSEW.TT", "AU2.TT", "BE.TT", "CA.EN.TT",
"ISSS.TT", "ROM.TT", "DE.SEA74.TT", "DE.TGL85.TT", "USDA1911",
"BRASIL.TT", "PL.TT" )
# Filename template
fn <- "assets/img/textureGallery/%s-%s.PNG"
# Generate triangle plots and save as PNG
for( tr in triangleList ){
for( type in c( "simple", "gradient" ) ){
# tr <- triangleList[ 1L ]; type <- "simple"
png(
filename = file.path( wd, sprintf( fn, tr, type ) ),
width = 1024,
height = 1024,
res = 75 * 1
)
if( type == "simple" ){
TT.plot( class.sys = tr )
}else{
TT.plot( class.sys = tr, class.p.bg.col = TRUE )
}
dev.off()
}
}
```
```{r extract-titles, echo=FALSE}
pr <- TT.get()
# Extract plot titles:
main <- unlist( lapply( X = triangleList, FUN = function(tr){
return( pr[[ tr ]][[ "main" ]] ) } ) )
```
```{r generate-page-menu, echo=FALSE, results="asis"}
menu <- unlist( lapply(
X = 1:length(triangleList),
FUN = function(i){
return( sprintf(
"[%s](#%s)",
main[ i ],
triangleList[ i ]
) )
}
) )
menu <- paste( menu, collapse = " &middot; " )
menu <- paste( "Page content:", menu, "\n\n" )
cat( menu, sep = "" )
```
Notes on non-explicit triangle names:
* "ISSS" is the triangle from the International Society
of Soil Science (now International Union of Soil Sciences -
IUSS).
* "SRTS 2003" is a Romanian texture triangle.
* "Standortserkundungsanweisung SEA 1974 (DE)", "TGL 24300-05"
and "landwirtschaftliche Boeden (DE)" are three German texture
triangles (presently used, or used in the past).
* "PL" is a Polish texture triangle.
* "USDA 1911 (M. Whitney, 1911)" is a historical version of the
USDA texture triangle.
See the [package tutorial](http://cran.r-project.org/web/packages/soiltexture/vignettes/soiltexture_vignette.pdf)
for more information on all these texture triangles.
```{r generate-image-gallery, echo=FALSE, results="asis"}
content <- unlist( lapply(
X = 1:length(triangleList),
FUN = function(i){
out <- c(
sprintf( '%s<a id="%s"></a>', main[ i ], triangleList[ i ] ),
paste(
rep( "-", times = nchar( main[ i ] ) ),
collapse = ""
),
sprintf(
'![%s](/%s "%s")',
triangleList[ i ],
sprintf( fn, triangleList[ i ], "gradient" ),
main[ i ]
),
sprintf(
"Image without color gradient available [here](/%s).",
sprintf( fn, triangleList[ i ], "simple" )
)
)
out <- paste( out, "\n", sep = "" )
out[ length( out ) ] <- paste(
out[ length( out ) ],
"\n\n",
sep = "" )
return( out )
}
) )
cat( content, sep = "" )
```
Technical information
---------------------
View the <a href="{{ site.github }}/blob/master/_posts/2015-02-06-texture-triangle-gallery.Rmd">
source code used to generate these figures</a> on Github ([knitr][]
.Rmd code).
Below some informations on the system settings and version of packages
used to generate these figures.
```{r tech-info, echo=TRUE}
ip <- installed.packages()
# Package version
ip[ "soiltexture", "Version" ]
ip[ "knitr", "Version" ]
# System information
sessionInfo()
```
<!-- List of links -->
[knitr]: http://cran.r-project.org/web/packages/knitr/ "knitr R package (CRAN)"
[soiltexture]: http://cran.r-project.org/web/packages/soiltexture/ "soiltexture R package (CRAN)"