[Soiltexture-commits] r90 - in pkg/soiltexture: . R man tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jan 9 11:08:56 CET 2014
Author: jmoeys
Date: 2014-01-09 11:08:56 +0100 (Thu, 09 Jan 2014)
New Revision: 90
Removed:
pkg/soiltexture/man/TT.check.ps.lim.Xm.Rd
pkg/soiltexture/man/TT.text.transf.Xm.Rd
pkg/soiltexture/tests/TT.text.transf.Xm.R
Modified:
pkg/soiltexture/NEWS
pkg/soiltexture/R/onAttach.R
pkg/soiltexture/R/soiltexture.R
Log:
Modified: pkg/soiltexture/NEWS
===================================================================
--- pkg/soiltexture/NEWS 2014-01-09 10:08:31 UTC (rev 89)
+++ pkg/soiltexture/NEWS 2014-01-09 10:08:56 UTC (rev 90)
@@ -3,31 +3,39 @@
Julien MOEYS
-----------------------------------------------------------------------------------------
-o version 1.2.10
+VERSION 1.2.11
- 20120912 Implemented a new version of the Australian soil texture classification
- (AU2.TT)
+ 2014/01/08 Compiled under R 3.0.2
+
+ The functions: TT.check.ps.lim.Xm() and TT.text.transf.Xm()
+ have been moved to the package
+ soiltexturetransformation, available on r-forge
+ (https://r-forge.r-project.org/R/?group_id=740)
-o version 1.2.9
+VERSION 1.2.10
+ 2013/04/29 Compiled under R 3.0.0
+
+VERSION 1.2.9
+
20120307 Removed a useless usage of installed.packages()
20120308 Compact the vignettes before R CMD build
-o version 1.2.8
+VERSION 1.2.8
20120125 New attempt to fix xtable package dependence in the vignette.
-o version 1.2.7
+VERSION 1.2.7
20120106 no visible change (fixed package dependance in vignette) + corrected TT.plot()
example for Spanish language.
-o version 1.2.6
+VERSION 1.2.6
20111112 Added the German (GDR) texture triangle for forest soils:
"Standortserkundungsanweisung SEA 1974 (DE)"
-o older versions
+VERSION < 1.2.6
20111109 New attempt to fix problems while loading the Polish texture triangle
under Mac/Darwin and freeBSD.
Modified: pkg/soiltexture/R/onAttach.R
===================================================================
--- pkg/soiltexture/R/onAttach.R 2014-01-09 10:08:31 UTC (rev 89)
+++ pkg/soiltexture/R/onAttach.R 2014-01-09 10:08:56 UTC (rev 90)
@@ -1,28 +1,36 @@
.onAttach <- function(# Internal. Message displayed when loading the package.
libname,
pkgname
-){ #
+){
#cat( "'", pkgname, "' loaded.\n" )
- #
+
# Setup the polish triangle and language setting
## if( !(tolower(Sys.info()["sysname"]) %in% c("mac","darwin")) )
- if( tolower(Sys.info()["sysname"]) %in% c("windows") ) # "linux",
- { #
- source( system.file( "polish_triangle.r", package = pkgname ), encoding = "UTF-8" )
- source( system.file( "polish_language.r", package = pkgname ), encoding = "UTF-8" )
+
+ if( tolower(Sys.info()["sysname"]) %in% c("windows") ){ # "linux",
+ try( source( system.file( "polish_triangle.r",
+ package = pkgname ), encoding = "UTF-8" ) )
+ tryRes <- try( source( system.file( "polish_language.r",
+ package = pkgname ), encoding = "UTF-8" ) )
+
}else{
- source( system.file( "polish_triangle_ANSI.r", package = pkgname ) )
- source( system.file( "polish_language_ANSI.r", package = pkgname ) )
- } #
- #
- lang.par <- TT.get( "lang.par" )
- lang.par <- rbind(
- lang.par,
- lang.par2
- ) #
- #
+ try( source( system.file( "polish_triangle_ANSI.r",
+ package = pkgname ) ) )
+ tryRes <- try( source( system.file( "polish_language_ANSI.r",
+ package = pkgname ) ) )
+ }
+
+ if( !("try-error" %in% class( tryRes )) ){
+ lang.par <- TT.get( "lang.par" )
+
+ lang.par <- rbind(
+ lang.par,
+ lang.par2
+ )
+ }
+
TT.set( "lang.par" = lang.par )
- #
+
packageStartupMessage(
paste("'", pkgname, "' loaded.", sep = "" )
) #
Modified: pkg/soiltexture/R/soiltexture.R
===================================================================
--- pkg/soiltexture/R/soiltexture.R 2014-01-09 10:08:31 UTC (rev 89)
+++ pkg/soiltexture/R/soiltexture.R 2014-01-09 10:08:56 UTC (rev 90)
@@ -4274,11 +4274,11 @@
text.sum = NULL
){ #
TT.auto.set(set.par=FALSE)
- #
- require( "MASS" )
- #
+
+ # require( "MASS" )
+
nm <- c(css.names,"Z")
- #
+
CorMat <- as.matrix( data.frame(
# # "1", "2", "3", "Z"
"1" = c(+1.000,+0.300,-0.600,+0.500),
@@ -5865,9 +5865,9 @@
){ #
if( is.null( class.sys ) ){ class.sys <- TT.get("class.sys") }
- #
- require( "sp" )
- #
+
+ # require( "sp" )
+
TT.data <- TT.get(class.sys)
#
if( is.null(collapse) ){ collapse = ", " }
@@ -5990,9 +5990,9 @@
"ypos" = tri.data[,css.names[1]]
) #
} #
- #
- require( "sp" )
- #
+
+ # require( "sp" )
+
# Vectorisable and custom wrapper for point.in.polygon():
points.in.class <- function(
X, # X = class name
@@ -6580,9 +6580,9 @@
inverted = FALSE,
...
) #
- #
- require( "sp" )
- #
+
+ # require( "sp" )
+
PiP <- as.logical( point.in.polygon(
point.x = xy.grid[["xypos"]][,"xpos"],
point.y = xy.grid[["xypos"]][,"ypos"],
@@ -6712,9 +6712,9 @@
"x" = dens.xy[["x"]],
"y" = dens.xy[["y"]]
) #
- #
- require( "sp" )
- #
+
+ # require( "sp" )
+
PiP <- as.logical( point.in.polygon(
point.x = ex.dens.xy[,"x"],
point.y = ex.dens.xy[,"y"],
@@ -6866,9 +6866,9 @@
}, #
z.vec = xy.data[,"z"]
) ) #
- #
- require( "sp" )
- #
+
+ # require( "sp" )
+
PiP <- as.logical( point.in.polygon(
point.x = xy.grid[["xypos"]][,"xpos"],
point.y = xy.grid[["xypos"]][,"ypos"],
@@ -7492,3 +7492,5 @@
# +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
# | END OF THE R CODE |
# +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
+
+
Deleted: pkg/soiltexture/man/TT.check.ps.lim.Xm.Rd
===================================================================
--- pkg/soiltexture/man/TT.check.ps.lim.Xm.Rd 2014-01-09 10:08:31 UTC (rev 89)
+++ pkg/soiltexture/man/TT.check.ps.lim.Xm.Rd 2014-01-09 10:08:56 UTC (rev 90)
@@ -1,48 +0,0 @@
-\name{TT.check.ps.lim.Xm}
-
-\alias{TT.check.ps.lim.Xm}
-
-\title{Internal. Check the consistency between 'base.ps.lim' and 'dat.ps.lim'. }
-
-\description{Check the consistency between 'base.ps.lim' and 'dat.ps.lim'.
-
-4 tests performed.}
-
-\usage{TT.check.ps.lim.Xm(base.ps.lim, dat.ps.lim, ps.lim.length = c(4,
-
- 4))}
-
-\arguments{
-
- \item{base.ps.lim}{
-
-}
-
- \item{dat.ps.lim}{
-
-}
-
- \item{ps.lim.length}{vector of 2 integers. Number of particle size classes + 1. c(base,dat)}
-
-}
-
-
-
-
-
-
-
-\author{Wei Shangguan
-
-Julien MOEYS <jules_m78-soiltexture at yahoo.fr>, contributions from Wei Shangguan.}
-
-
-
-
-
-
-
-
-
-
-
Deleted: pkg/soiltexture/man/TT.text.transf.Xm.Rd
===================================================================
--- pkg/soiltexture/man/TT.text.transf.Xm.Rd 2014-01-09 10:08:31 UTC (rev 89)
+++ pkg/soiltexture/man/TT.text.transf.Xm.Rd 2014-01-09 10:08:56 UTC (rev 90)
@@ -1,158 +0,0 @@
-\name{TT.text.transf.Xm}
-
-\alias{TT.text.transf.Xm}
-
-\title{Transformations of a soil texture data table between 2 particle size systems (X classes), various methods.}
-
-\description{using various Particle Size Distribution (PSD) models including Anderson (AD), Fredlund4P (F4P), Fredlund3P (F3P),
-
-modified logistic growth (ML), Offset-Nonrenormalized Lognormal (ONL), Offset-Renormalized Lognormal (ORL),
-
-Skaggs (S), van Genuchten type(VG),van Genuchten modified(VGM), Weibull (W), Logarithm(L),
-
-Logistic growth (LG), Simple Lognormal (SL),Shiozawa and Compbell (SC).
-
-The performance of PSD models is influenced by many aspects like soil texture class,
-
-number and position (or closeness) of observation points, clay content etc.
-
-The latter four PSD models perform worse than the former ten.
-
-The AD, F4P, S, and W model is recommended for most of texture classes.
-
-And it will be even better to compare several different PSD models and using the results of the model
-
-with the minimum residual sum of squares (or other measures).
-
-Sometimes, the fitting will failed for the iteration is not converged or some errors happened.
-
-Transformation of a soil texture data table
-
-('tri.data') from one
-
-particle size system ('dat.ps.lim') into another
-
-('base.ps.lim'). No limit in the number of texture classes
-
-in the input and output texture tables. See TT.text.transf
-
-for transformation involving only 3 particle classes. 'tri.data'
-
-can only contain texture data.
-
-This function requires the "drc" package to be installed.}
-
-\usage{TT.text.transf.Xm(tri.data, base.ps.lim, dat.ps.lim, text.sum = NULL,
-
- text.tol = NULL, tri.sum.tst = NULL, tri.pos.tst = NULL,
-
- psdmodel = "AD", omethod = "all", tri.sum.norm = FALSE)}
-
-\arguments{
-
- \item{tri.data}{
-
-}
-
- \item{base.ps.lim}{
-
-}
-
- \item{dat.ps.lim}{
-
-}
-
- \item{text.sum}{
-
-}
-
- \item{text.tol}{
-
-}
-
- \item{tri.sum.tst}{
-
-}
-
- \item{tri.pos.tst}{
-
-}
-
- \item{psdmodel}{
-
-}
-
- \item{omethod}{see optim for available methods, the default "all" is to run all methods and
-
-choose the best results with minimum residual sum of squares (RSS).}
-
- \item{tri.sum.norm}{Weather the sum of is}
-
-}
-
-
-
-
-
-
-
-\author{Wei Shangguan
-
-Julien MOEYS <jules_m78-soiltexture at yahoo.fr>, contributions from Wei Shangguan.}
-
-
-
-
-
-
-
-
-
-\examples{require( "soiltexture" )
-
-require( "drc" )
-
-
-
-my.text4 <- data.frame(
-
- "CLAY" = c(05,60,15,05,25,05,25,45,65,75,13,47),
-
- "FSILT" = c(02,04,10,15,25,40,35,20,10,05,10,20),
-
- "CSILT" = c(03,04,05,10,30,45,30,25,05,10,07,23),
-
- "SAND" = c(90,32,70,70,20,10,10,10,20,10,70,10)
-
-) #
-
-
-
-TT.text.transf.Xm(
-
- tri.data = my.text4,
-
- base.ps.lim = c(0,2,20,50,2000),
-
- dat.ps.lim = c(0,2,20,63,2000),
-
- psdmodel = "S"
-
-) #
-
-
-
-# TT.text.transf.Xm(
-
-# tri.data = my.text4,
-
-# base.ps.lim = c(0,1,50,2000),
-
-# dat.ps.lim = c(0,2,30,60,2000),
-
-# psdmodel = "AD",
-
-# omethod = "Nelder-Mead"
-
-# ) }
-
Deleted: pkg/soiltexture/tests/TT.text.transf.Xm.R
===================================================================
--- pkg/soiltexture/tests/TT.text.transf.Xm.R 2014-01-09 10:08:31 UTC (rev 89)
+++ pkg/soiltexture/tests/TT.text.transf.Xm.R 2014-01-09 10:08:56 UTC (rev 90)
@@ -1,24 +0,0 @@
-require( "soiltexture" )
-require( "drc" )
-
-my.text4 <- data.frame(
- "CLAY" = c(05,60,15,05,25,05,25,45,65,75,13,47),
- "FSILT" = c(02,04,10,15,25,40,35,20,10,05,10,20),
- "CSILT" = c(03,04,05,10,30,45,30,25,05,10,07,23),
- "SAND" = c(90,32,70,70,20,10,10,10,20,10,70,10)
-) #
-
-TT.text.transf.Xm(
- tri.data = my.text4,
- base.ps.lim = c(0,2,20,50,2000),
- dat.ps.lim = c(0,2,20,63,2000),
- psdmodel = "S"
-) #
-
-# TT.text.transf.Xm(
-# tri.data = my.text4,
-# base.ps.lim = c(0,1,50,2000),
-# dat.ps.lim = c(0,2,30,60,2000),
-# psdmodel = "AD",
-# omethod = "Nelder-Mead"
-# )
More information about the Soiltexture-commits
mailing list