[Soiltexture-commits] r99 - / pkg/ternaryplot pkg/ternaryplot/R pkg/ternaryplot/inst/examples pkg/ternaryplot/man pkg/ternaryplot/tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jan 15 14:04:02 CET 2014
Author: jmoeys
Date: 2014-01-15 14:04:01 +0100 (Wed, 15 Jan 2014)
New Revision: 99
Added:
pkg/ternaryplot/man/ternaryAxisArrows-methods.Rd
pkg/ternaryplot/man/ternaryAxisArrowsBase-methods.Rd
pkg/ternaryplot/man/ternaryText-methods.Rd
pkg/ternaryplot/tests/baseTests.R
Modified:
pkg/ternaryplot/DESCRIPTION
pkg/ternaryplot/NAMESPACE
pkg/ternaryplot/R/aaa-ternaryplot-classes.R
pkg/ternaryplot/R/ternaryplot.R
pkg/ternaryplot/inst/examples/ternarySystem.R
pkg/ternaryplot/inst/examples/ternaryVariables.R
pkg/ternaryplot/man/blrClock-methods.Rd
pkg/ternaryplot/man/blrNames-methods.Rd
pkg/ternaryplot/man/fracSum-methods.Rd
pkg/ternaryplot/man/ternaryArrows-methods.Rd
pkg/ternaryplot/man/ternaryGridBase-methods.Rd
pkg/ternaryplot/man/ternarySystem-class.Rd
pkg/ternaryplot/man/ternaryVariables-class.Rd
pkg/ternaryplot/man/ternaryWindow-methods.Rd
pkg/ternaryplot/man/tlrAngles-methods.Rd
pkg/ternaryplot/man/tpPar.Rd
ternaryplot_1_RCMDbuild.bat
ternaryplot_2_RCMDcheck.bat
ternaryplot_3_RCMDINSTALL_build.BAT
ternaryplot_Document.R
Log:
Modified: pkg/ternaryplot/DESCRIPTION
===================================================================
--- pkg/ternaryplot/DESCRIPTION 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/DESCRIPTION 2014-01-15 13:04:01 UTC (rev 99)
@@ -1,10 +1,11 @@
Package: ternaryplot
-Version: 0.1.1
-Date: 2013-06-27
+Version: 0.1.2
+Date: 2014-01-15
Title: Ternary plots and ternary classifications.
Author: Julien MOEYS <Julien.Moeys at slu.se>
Maintainer: Julien MOEYS <Julien.Moeys at slu.se>
Description: Ternary plots and ternary classifications.
License: AGPL-3
URL: http://www.slu.se/ckb
-Depends: R (>= 3.0.0), methods
+Depends: R (>= 3.0.2), methods
+Suggests:
Modified: pkg/ternaryplot/NAMESPACE
===================================================================
--- pkg/ternaryplot/NAMESPACE 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/NAMESPACE 2014-01-15 13:04:01 UTC (rev 99)
@@ -2,6 +2,8 @@
export("blrNames<-")
export("fracSum<-")
export("tlrAngles<-")
+export(.ternaryAxisArrows)
+export(.ternaryAxisArrowsBase)
export(.ternaryGridBase)
export(.ternaryTicks)
export(blr2xy)
@@ -19,6 +21,7 @@
export(ternarySegments)
export(ternarySystemGet)
export(ternarySystemList)
+export(ternaryText)
export(ternaryWindow)
export(tlrAngles)
export(tpPar)
@@ -29,6 +32,8 @@
exportMethods("blrNames<-")
exportMethods("fracSum<-")
exportMethods("tlrAngles<-")
+exportMethods(.ternaryAxisArrows)
+exportMethods(.ternaryAxisArrowsBase)
exportMethods(.ternaryGridBase)
exportMethods(.ternaryTicks)
exportMethods(blr2xy)
@@ -43,5 +48,6 @@
exportMethods(ternaryPlot)
exportMethods(ternaryPoints)
exportMethods(ternarySegments)
+exportMethods(ternaryText)
exportMethods(ternaryWindow)
exportMethods(tlrAngles)
Modified: pkg/ternaryplot/R/aaa-ternaryplot-classes.R
===================================================================
--- pkg/ternaryplot/R/aaa-ternaryplot-classes.R 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/R/aaa-ternaryplot-classes.R 2014-01-15 13:04:01 UTC (rev 99)
@@ -110,7 +110,7 @@
#contains = numeric(),
- validity = function(object){
+ validity = function(object){
msg <- character(0)
if( length( object@'blrNames' ) != 3 ){
Modified: pkg/ternaryplot/R/ternaryplot.R
===================================================================
--- pkg/ternaryplot/R/ternaryplot.R 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/R/ternaryplot.R 2014-01-15 13:04:01 UTC (rev 99)
@@ -7,6 +7,7 @@
# Useful: \code{} \code{\link[]{}}
+# TO DO: ADD A TEXT LABEL in .ternaryTicks()
@@ -343,6 +344,8 @@
#'
ternaryWindow <- function(
s,
+ x,
+ scale = FALSE,
...
){
standardGeneric( "ternaryWindow" )
@@ -353,7 +356,9 @@
setGeneric(
"ternaryWindow",
function(
- s,
+ s,
+ x,
+ scale = FALSE,
...
){
standardGeneric( "ternaryWindow" )
@@ -373,6 +378,8 @@
signature = "missing",
definition = function(
s,
+ x,
+ scale = FALSE,
...
){
# Set the ternarySystem
@@ -395,6 +402,8 @@
signature = "character",
definition = function(
s,
+ x,
+ scale = FALSE,
...
){
# Set the ternarySystem
@@ -798,12 +807,18 @@
#'@param from
#' A \code{\link[base]{data.frame}} or a
#' \code{\link[base]{matrix}} containing the ternary
-#' coordinates of points *from* which to draw.
+#' coordinates of points *from* which to draw the arrows.
+#' Each row is an arrow, and the columns must correspond
+#' to \code{blrNames(s)} (variable names for the bottom,
+#' left and right axis).
#'
#'@param to
#' A \code{\link[base]{data.frame}} or a
#' \code{\link[base]{matrix}} containing the ternary
-#' coordinates of points *to* which to draw.
+#' coordinates of points *to* which to draw the arrows.
+#' Each row is an arrow, and the columns must correspond
+#' to \code{blrNames(s)} (variable names for the bottom,
+#' left and right axis).
#'
#'@param s
#' A \code{\linkS4class{ternarySystem}} object, or a
@@ -885,9 +900,9 @@
-#'Internal. Calculates grid segments start and end ternary coordinates
+#'INTERNAL. Calculates grid segments start and end ternary coordinates
#'
-#'Internal. Calculates grid segments start and end ternary coordinates
+#'INTERNAL. Calculates grid segments start and end ternary coordinates
#'
#'
#'@param s
@@ -908,13 +923,15 @@
#'
#'@docType methods
#'
-.ternaryGridBase <- function( s, ... ){
+#'@keywords internal
+#'
+.ternaryGridBase <- function( s, ticks = FALSE, ... ){
standardGeneric( ".ternaryGridBase" )
}
rm(".ternaryGridBase")
-setGeneric( ".ternaryGridBase", function( s, ... ){
+setGeneric( ".ternaryGridBase", function( s, ticks = FALSE, ... ){
standardGeneric( ".ternaryGridBase" )
} )
@@ -1181,9 +1198,9 @@
-#'Draw axis' ticks mark on a triangle plot
+#'Draw axis' tick marks on a triangle plot
#'
-#'Draw axis' ticks mark on a triangle plot
+#'Draw axis' tick marks on a triangle plot
#'
#'
#'@param s
@@ -1247,7 +1264,9 @@
from = gr[[ "from" ]][[ ax ]],
to = gr[[ "to" ]][[ ax ]],
s = s )
-
+
+ # TO DO: ADD A TEXT LABEL
+
# Set test again
tpPar( par = oldPar )
}
@@ -1428,9 +1447,14 @@
.ternaryTicks( s = s )
ternaryGrid( s = s )
ternaryBox( s = s )
+ try( .ternaryAxisArrows( s = s ) )
- message( "Method (data.frame,ternarySystem) not implemented yet" )
+ if( nrow( x ) >= 1 ){
+ message( "Method (data.frame,ternarySystem) not implemented yet" )
+ }
+
+ return( invisible( s ) )
}
)
@@ -1493,9 +1517,9 @@
)
-#'NOT EXPORTED: Find optimal axis limits for a ternary plot.
+#'INTERNAL: Find optimal axis limits for a ternary plot.
#'
-#'NOT EXPORTED: Find optimal axis limits for a ternary plot.
+#'INTERNAL: Find optimal axis limits for a ternary plot.
#'
#'
#'@usage
@@ -1530,6 +1554,8 @@
#'
#'@docType methods
#'
+#'@keywords internal
+#'
ternaryLims <- function(
x,
s = "default",
@@ -1922,7 +1948,7 @@
#'@rdname blrNames-methods
#'
#'@usage
-#' \S4method{blrNames<-}{ternarySystem}( s, \dots ) <- value
+#' \S4method{blrNames}{ternarySystem}( s, \dots ) <- value
#'
#'@export
#'
@@ -2032,7 +2058,7 @@
#'@rdname blrClock-methods
#'
#'@usage
-#' \S4method{blrClock<-}{ternarySystem}( x, \dots ) <- value
+#' \S4method{blrClock}{ternarySystem}( x, \dots ) <- value
#'
#'@export
#'
@@ -2070,7 +2096,57 @@
+# ==================== ternaryClockSwitch ====================
+#'INTERNAL. Fetch a pre-defined ternary classification system
+#'
+#'INTERNAL. Fetch a pre-defined ternary classification system
+#'
+#'
+#'@param s
+#' Single character string. Name of the ternary classification to
+#' be fetched.
+#'
+#'
+#'@return
+#' A \code{\linkS4class{ternarySystem}} object.
+#'
+#'
+#'@export
+#'
+#'@keywords internal
+#'
+ternaryClockSwitch <- function(
+ s,
+ ttt,
+ txf,
+ ftx,
+ fff
+){
+ if( is.character( s ) ){
+ s <- ternarySystemGet( s )
+ }
+
+ vBlrClock <- blrClock( s )
+
+ if( all( vBlrClock == c( TRUE, TRUE, TRUE ) ) ){
+ out <- ttt
+ }else if( all( vBlrClock == c( TRUE, NA, FALSE ) ) ){
+ out <- ttt
+ }else if( all( vBlrClock == c( FALSE, TRUE, NA ) ) ){
+ out <- ftx
+ }else if( all( vBlrClock == c( FALSE, FALSE, FALSE ) ) ){
+ out <- fff
+ }else{
+ stop( "unknown value for blrClock( s ): %s",
+ paste( vBlrClock, collapse = ", " ) )
+ }
+
+ return( out )
+}
+
+
+
# ==================== fracSum ====================
#'Set or get the sum of the three fractions of a ternarySystem
@@ -2132,7 +2208,7 @@
#'@rdname fracSum-methods
#'
#'@usage
-#' \S4method{fracSum<-}{ternarySystem}( x, \dots ) <- value
+#' \S4method{fracSum}{ternarySystem}( x, \dots ) <- value
#'
#'@export
#'
@@ -2232,7 +2308,7 @@
#'@rdname tlrAngles-methods
#'
#'@usage
-#' \S4method{tlrAngles<-}{ternarySystem}( x, \dots ) <- value
+#' \S4method{tlrAngles}{ternarySystem}( x, \dots ) <- value
#'
#'@export
#'
@@ -2477,7 +2553,7 @@
setMethod(
f = "ternaryText",
signature = "data.frame",
- definition = function( x, s, ... ){
+ definition = function( x, labels, s, ... ){
# Set the value for s
if( missing( s ) ){
s <- ternarySystemSet()
@@ -2516,9 +2592,11 @@
# ============ .ternaryAxisArrowsBase ============
-#'INTERNAL. Calculates arrows segments start and end for ternary axis labels
+#'INTERNAL. Calculates arrows segments start and end for ternary
+#' axis labels
#'
-#'INTERNAL. Calculates arrows segments start and end for ternary axis labels
+#'INTERNAL. Calculates arrows segments start and end for ternary
+#' axis labels
#'
#'
#'@param s
@@ -2528,12 +2606,14 @@
#' Additional parameters passed to specific methods.
#'
#'
-#'@rdname ternaryGridBase-methods
+#'@rdname ternaryAxisArrowsBase-methods
#'
#'@export
#'
#'@docType methods
#'
+#'@keywords internal
+#'
.ternaryAxisArrowsBase <- function( s, ... ){
standardGeneric( ".ternaryAxisArrowsBase" )
}
@@ -2741,10 +2821,10 @@
# ============ .ternaryAxisArrows ============
-#' INTERNAL: Draw axis' arrows and arrows' lables mark on a
+#' INTERNAL: Draw axis' arrows and arrows' label marks on a
#' triangle plot
#'
-#' INTERNAL: Draw axis' arrows and arrows' lables mark on a
+#' INTERNAL: Draw axis' arrows and arrows' label marks on a
#' triangle plot
#'
#'
@@ -2761,12 +2841,14 @@
# for each of the 3 axis.
#'
#'
-#'@rdname ternaryTicks-methods
+#'@rdname ternaryAxisArrows-methods
#'
#'@export
#'
#'@docType methods
#'
+#'@keywords internal
+#'
.ternaryAxisArrows <- function( s, ... ){
standardGeneric( ".ternaryAxisArrows" )
}
@@ -2796,6 +2878,22 @@
tlrAnglez <- tlrAngles( x = s )
blrLabelAngles <- c( 0, tlrAnglez[2], tlrAnglez[3] )
+ # Change sign for the case when blrClock(s) is not TRUE NA FALSE
+ if( !is.na( blrClock(s)[2] ) ){
+ blrLabelAngles[3] <- -blrLabelAngles[3]
+ }
+
+
+ # Chose the right adjustment
+ adj <- ternaryClockSwitch(
+ s = s,
+ ttt = c( 1, 0, 0 ),
+ txf = c( 1, 1, 0 ),
+ ftx = c( 0, 0, 0 ),
+ fff = c( 0, 1, 1 )
+ )
+
+
for( ax in 1:length( gr ) ){
# Draw the tick-marks start and segments
if( nrow( gr[[ ax ]] ) != 0 ){
@@ -2829,7 +2927,8 @@
x = gr[[ ax ]][ 4, ],
labels = s@'ternaryVariables'@'blrLabels'[ ax ],
s = s,
- pos = 2,
+ # pos = 2,
+ adj = c( adj[ ax ], .5 ),
srt = blrLabelAngles[ ax ],
... )
Modified: pkg/ternaryplot/inst/examples/ternarySystem.R
===================================================================
--- pkg/ternaryplot/inst/examples/ternarySystem.R 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/inst/examples/ternarySystem.R 2014-01-15 13:04:01 UTC (rev 99)
@@ -6,30 +6,28 @@
tsy
## Custom variables
-tsy <- new(
+tsy2 <- new(
"ternarySystem",
"ternaryVariables" = new(
"ternaryVariables",
- ## Do not change 'blrNames' as it requires to set vertices
- ## as well!
- #"blrNames" = c( "B", "L", "R" ),
- "blrLabels" = c( "B [%]", "L [%]", "R [%]" )
+ # "blrNames" = c( "CLAY", "SILT", "SAND" ), # won't work
+ "blrLabels" = c( "Clay [%]", "Silt [%]", "Sand [%]" )
),
"ternaryGeometry" = new(
"ternaryGeometry",
"fracSum" = 100,
- "tlrAngles" = c( 45, 45, 90 )
+ "tlrAngles" = c( 45, 45, 90 ) # top, left, right angles
),
- "main" = "My ternary plot"
-)
-tsy
+ "main" = "My ternary plot" )
-## Changing variable names is a bit more complicated:
-blrNames( tsy ) <- c( "B", "L", "R" )
+# Changing variable names must be done 'afterwards', because
+# it also requires other internal changes in the ternarySystem
+# (like the definition of class vertices)
+blrNames( tsy2 ) <- c( "CLAY", "SILT", "SAND" )
+tsy2
-
## Methods defined for ternaryGeometry:
showMethods( class = "ternarySystem" )
Modified: pkg/ternaryplot/inst/examples/ternaryVariables.R
===================================================================
--- pkg/ternaryplot/inst/examples/ternaryVariables.R 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/inst/examples/ternaryVariables.R 2014-01-15 13:04:01 UTC (rev 99)
@@ -6,11 +6,11 @@
tv
## Custom variables
-tv <- new(
+tv2 <- new(
"ternaryVariables",
blrNames = c( "CLAY", "SILT", "SAND" ),
blrLabels = c( "Clay [%]", "SILT [%]", "SAND [%]" ) )
-tv
+tv2
## Methods defined for ternaryGeometry:
Modified: pkg/ternaryplot/man/blrClock-methods.Rd
===================================================================
--- pkg/ternaryplot/man/blrClock-methods.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/blrClock-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -9,7 +9,7 @@
\usage{
\S4method{blrClock}{ternarySystem}( x, \dots )
- \S4method{blrClock<-}{ternarySystem}( x, \dots ) <- value
+ \S4method{blrClock}{ternarySystem}( x, \dots ) <- value
}
\arguments{
\item{x}{A \code{\linkS4class{ternarySystem}} object.}
Modified: pkg/ternaryplot/man/blrNames-methods.Rd
===================================================================
--- pkg/ternaryplot/man/blrNames-methods.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/blrNames-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -9,7 +9,7 @@
\usage{
\S4method{blrNames}{ternarySystem}( s, \dots )
- \S4method{blrNames<-}{ternarySystem}( s, \dots ) <- value
+ \S4method{blrNames}{ternarySystem}( s, \dots ) <- value
}
\arguments{
\item{s}{A \code{\linkS4class{ternarySystem}} object.}
Modified: pkg/ternaryplot/man/fracSum-methods.Rd
===================================================================
--- pkg/ternaryplot/man/fracSum-methods.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/fracSum-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -9,7 +9,7 @@
\usage{
\S4method{fracSum}{ternarySystem}( x, \dots )
- \S4method{fracSum<-}{ternarySystem}( x, \dots ) <- value
+ \S4method{fracSum}{ternarySystem}( x, \dots ) <- value
}
\arguments{
\item{x}{A \code{\linkS4class{ternarySystem}} object.}
Modified: pkg/ternaryplot/man/ternaryArrows-methods.Rd
===================================================================
--- pkg/ternaryplot/man/ternaryArrows-methods.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/ternaryArrows-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -9,11 +9,17 @@
\arguments{
\item{from}{A \code{\link[base]{data.frame}} or a
\code{\link[base]{matrix}} containing the ternary
- coordinates of points *from* which to draw.}
+ coordinates of points *from* which to draw the arrows.
+ Each row is an arrow, and the columns must correspond to
+ \code{blrNames(s)} (variable names for the bottom, left
+ and right axis).}
\item{to}{A \code{\link[base]{data.frame}} or a
\code{\link[base]{matrix}} containing the ternary
- coordinates of points *to* which to draw.}
+ coordinates of points *to* which to draw the arrows.
+ Each row is an arrow, and the columns must correspond to
+ \code{blrNames(s)} (variable names for the bottom, left
+ and right axis).}
\item{s}{A \code{\linkS4class{ternarySystem}} object, or
a character string naming a pre-defined
Added: pkg/ternaryplot/man/ternaryAxisArrows-methods.Rd
===================================================================
--- pkg/ternaryplot/man/ternaryAxisArrows-methods.Rd (rev 0)
+++ pkg/ternaryplot/man/ternaryAxisArrows-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -0,0 +1,24 @@
+\docType{methods}
+\name{.ternaryAxisArrows}
+\alias{.ternaryAxisArrows}
+\alias{.ternaryAxisArrows,ternarySystem-method}
+\title{INTERNAL: Draw axis' arrows and arrows' label marks on a
+ triangle plot}
+\usage{
+ .ternaryAxisArrows(s, ...)
+}
+\arguments{
+ \item{s}{A \code{\linkS4class{ternarySystem}} object.}
+
+ \item{\dots}{Additional parameters passed to specific
+ methods.}
+}
+\value{
+ Invisibly returns a list of \code{data.frame} with the
+ start and end points of the arrows segments
+}
+\description{
+ INTERNAL: Draw axis' arrows and arrows' label marks on a
+ triangle plot
+}
+
Added: pkg/ternaryplot/man/ternaryAxisArrowsBase-methods.Rd
===================================================================
--- pkg/ternaryplot/man/ternaryAxisArrowsBase-methods.Rd (rev 0)
+++ pkg/ternaryplot/man/ternaryAxisArrowsBase-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -0,0 +1,20 @@
+\docType{methods}
+\name{.ternaryAxisArrowsBase}
+\alias{.ternaryAxisArrowsBase}
+\alias{.ternaryAxisArrowsBase,ternarySystem-method}
+\title{INTERNAL. Calculates arrows segments start and end for ternary
+ axis labels}
+\usage{
+ .ternaryAxisArrowsBase(s, ...)
+}
+\arguments{
+ \item{s}{A \code{\linkS4class{ternarySystem}} object.}
+
+ \item{\dots}{Additional parameters passed to specific
+ methods.}
+}
+\description{
+ INTERNAL. Calculates arrows segments start and end for
+ ternary axis labels
+}
+
Modified: pkg/ternaryplot/man/ternaryGridBase-methods.Rd
===================================================================
--- pkg/ternaryplot/man/ternaryGridBase-methods.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/ternaryGridBase-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -4,7 +4,7 @@
\alias{.ternaryGridBase,ternarySystem-method}
\title{Internal. Calculates grid segments start and end ternary coordinates}
\usage{
- .ternaryGridBase(s, ...)
+ .ternaryGridBase(s, ticks = FALSE, ...)
}
\arguments{
\item{s}{A \code{\linkS4class{ternarySystem}} object.}
Modified: pkg/ternaryplot/man/ternarySystem-class.Rd
===================================================================
--- pkg/ternaryplot/man/ternarySystem-class.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/ternarySystem-class.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -26,31 +26,29 @@
tsy
## Custom variables
-tsy <- new(
+tsy2 <- new(
"ternarySystem",
"ternaryVariables" = new(
"ternaryVariables",
- ## Do not change 'blrNames' as it requires to set vertices
- ## as well!
- #"blrNames" = c( "B", "L", "R" ),
- "blrLabels" = c( "B [\%]", "L [\%]", "R [\%]" )
+ # "blrNames" = c( "CLAY", "SILT", "SAND" ), # won't work
+ "blrLabels" = c( "Clay [\%]", "Silt [\%]", "Sand [\%]" )
),
"ternaryGeometry" = new(
"ternaryGeometry",
"fracSum" = 100,
- "tlrAngles" = c( 45, 45, 90 )
+ "tlrAngles" = c( 45, 45, 90 ) # top, left, right angles
),
- "main" = "My ternary plot"
-)
-tsy
+ "main" = "My ternary plot" )
-## Changing variable names is a bit more complicated:
-blrNames( tsy ) <- c( "B", "L", "R" )
+# Changing variable names must be done 'afterwards', because
+# it also requires other internal changes in the ternarySystem
+# (like the definition of class vertices)
+blrNames( tsy2 ) <- c( "CLAY", "SILT", "SAND" )
+tsy2
-
## Methods defined for ternaryGeometry:
showMethods( class = "ternarySystem" )
}
Added: pkg/ternaryplot/man/ternaryText-methods.Rd
===================================================================
--- pkg/ternaryplot/man/ternaryText-methods.Rd (rev 0)
+++ pkg/ternaryplot/man/ternaryText-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -0,0 +1,34 @@
+\docType{methods}
+\name{ternaryText}
+\alias{ternaryText}
+\alias{ternaryText,data.frame-method}
+\alias{ternaryText,matrix-method}
+\title{Draw text strings (labels) on a triangle plot}
+\usage{
+ ternaryText(x, labels, s, ...)
+}
+\arguments{
+ \item{x}{A \code{\link[base]{data.frame}} or a
+ \code{\link[base]{matrix}} containing ternary
+ data-points, coordinates of the text strings to be added
+ on the plot.}
+
+ \item{s}{A \code{\linkS4class{ternarySystem}} object, or
+ a character string naming a pre-defined
+ \code{ternarySystem}. If missing, set to
+ \code{default}.}
+
+ \item{labels}{A vector of character strings, or
+ expressions to be added on the triangle plot. See
+ \code{\link[graphics]{text}}.}
+
+ \item{\dots}{Additional parameters passed to
+ \code{\link[graphics]{text}}.}
+}
+\description{
+ Draw text strings (labels) on a triangle plot
+}
+\seealso{
+ \code{\link[graphics]{points}}.
+}
+
Modified: pkg/ternaryplot/man/ternaryVariables-class.Rd
===================================================================
--- pkg/ternaryplot/man/ternaryVariables-class.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/ternaryVariables-class.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -26,11 +26,11 @@
tv
## Custom variables
-tv <- new(
+tv2 <- new(
"ternaryVariables",
blrNames = c( "CLAY", "SILT", "SAND" ),
blrLabels = c( "Clay [\%]", "SILT [\%]", "SAND [\%]" ) )
-tv
+tv2
## Methods defined for ternaryGeometry:
Modified: pkg/ternaryplot/man/ternaryWindow-methods.Rd
===================================================================
--- pkg/ternaryplot/man/ternaryWindow-methods.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/ternaryWindow-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -6,7 +6,7 @@
\alias{ternaryWindow,ternarySystem-method}
\title{NOT EXPORTED Draw an invisible base-plot for ternaryPlot}
\usage{
- ternaryWindow(s, ...)
+ ternaryWindow(s, x, scale = FALSE, ...)
}
\arguments{
\item{s}{A \code{\linkS4class{ternarySystem}} object, or
Modified: pkg/ternaryplot/man/tlrAngles-methods.Rd
===================================================================
--- pkg/ternaryplot/man/tlrAngles-methods.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/tlrAngles-methods.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -9,8 +9,7 @@
\usage{
\S4method{tlrAngles}{ternarySystem}( x, \dots )
- \S4method{tlrAngles<-}{ternarySystem}( x, \dots ) <-
- value
+ \S4method{tlrAngles}{ternarySystem}( x, \dots ) <- value
}
\arguments{
\item{x}{A \code{\linkS4class{ternarySystem}} object.}
Modified: pkg/ternaryplot/man/tpPar.Rd
===================================================================
--- pkg/ternaryplot/man/tpPar.Rd 2014-01-10 15:40:11 UTC (rev 98)
+++ pkg/ternaryplot/man/tpPar.Rd 2014-01-15 13:04:01 UTC (rev 99)
@@ -3,7 +3,7 @@
\title{Get or set default parameters for the package.}
\usage{
tpPar(par = NULL, reset = FALSE, testRange, testSum,
- fracSumTol, ticksAt, ticksShift)
+ fracSumTol, ticksAt, ticksShift, arrowsShift)
}
\arguments{
\item{par}{Three possible cases: \itemize{ \item If
@@ -46,6 +46,10 @@
\item{ticksShift}{Single numeric. Tick-marks 'size',
expressed so that \code{ticksShift * fracSum} is the
length of the tick-marks.}
+
+ \item{arrowsShift}{Vector of tow numeric values. Axis'
+ arrows' shift from their axis, expressed so that
+ \code{arrowsShift * fracSum} is the start and end point.}
}
\value{
Returns a partial or complete list of (actual) parameter
Added: pkg/ternaryplot/tests/baseTests.R
===================================================================
--- pkg/ternaryplot/tests/baseTests.R (rev 0)
+++ pkg/ternaryplot/tests/baseTests.R 2014-01-15 13:04:01 UTC (rev 99)
@@ -0,0 +1,57 @@
+ # setwd( "/home/moeysj/Desktop/ternaryplot/pkg/ternaryplot/R" )
+
+ # source( "aaa-ternaryplot-classes.R" )
+ # source( "ternaryplot-options.R" )
+ # source( "ternaryplot.R" )
+ # source( "ternarySystems.R" )
+
+library( "ternaryplot" )
+
+
+# Run some tests
+s <- ternaryWindow() # Opens a plot window
+
+# or
+
+s <- ternaryWindow( "default" )
+
+# or
+
+s <- ternarySystemGet()
+# s@'ternaryGeometry'@'tlrAngles' <- c(45,90,45)
+
+s <- ternaryWindow( s = s )
+# .ternaryGridBase( s = s )
+
+.ternaryTicks( s = s )
+ternaryGrid( s = s )
+ternaryBox( s = s )
+
+blrClock( s ) <- rep( F, 3 )
+
+# s@'ternaryGeometry'@'tlrAngles' <- c(45,90,45)
+
+s <- ternaryWindow( s = s )
+# .ternaryGridBase( s = s )
+.ternaryTicks( s = s )
+ternaryGrid( s = s )
+ternaryBox( s = s )
+
+blrClock( s ) <- c( F, T, NA )
+tlrAngles( s ) <- c(45,90,45)
+
+s <- ternaryWindow( s = s )
+.ternaryTicks( s = s )
+ternaryGrid( s = s )
+ternaryBox( s = s )
+
+
+blrClock( s ) <- c( T, NA, F )
+tlrAngles( s ) <- c(45,45,90)
+s <- ternaryWindow( s = s )
+.ternaryTicks( s = s )
+ternaryGrid( s = s )
+ternaryBox( s = s )
+
+
+
Modified: ternaryplot_1_RCMDbuild.bat
===================================================================
--- ternaryplot_1_RCMDbuild.bat 2014-01-10 15:40:11 UTC (rev 98)
+++ ternaryplot_1_RCMDbuild.bat 2014-01-15 13:04:01 UTC (rev 99)
@@ -1,7 +1,7 @@
set pkgname=ternaryplot
-cd /D "%rPackagesDir%\%pkgname%\pkg"
+cd /D "%rPackagesDir%\soiltexture\pkg"
-R CMD build --compact-vignettes="gs" %pkgname%
+R CMD build --compact-vignettes="gs+qpdf" %pkgname%
pause
Modified: ternaryplot_2_RCMDcheck.bat
===================================================================
--- ternaryplot_2_RCMDcheck.bat 2014-01-10 15:40:11 UTC (rev 98)
+++ ternaryplot_2_RCMDcheck.bat 2014-01-15 13:04:01 UTC (rev 99)
@@ -1,6 +1,6 @@
set pkgname=ternaryplot
-cd /D "%rPackagesDir%\%pkgname%\pkg"
+cd /D "%rPackagesDir%\soiltexture\pkg"
R CMD check %pkgname%
Modified: ternaryplot_3_RCMDINSTALL_build.BAT
===================================================================
--- ternaryplot_3_RCMDINSTALL_build.BAT 2014-01-10 15:40:11 UTC (rev 98)
+++ ternaryplot_3_RCMDINSTALL_build.BAT 2014-01-15 13:04:01 UTC (rev 99)
@@ -1,6 +1,6 @@
set pkgname=ternaryplot
-cd /D "%rPackagesDir%\%pkgname%\pkg"
+cd /D "%rPackagesDir%\soiltexture\pkg"
R CMD INSTALL --build --compact-docs --byte-compile %pkgname%
Modified: ternaryplot_Document.R
===================================================================
--- ternaryplot_Document.R 2014-01-10 15:40:11 UTC (rev 98)
+++ ternaryplot_Document.R 2014-01-15 13:04:01 UTC (rev 99)
@@ -1,9 +1,10 @@
+
rm(list=ls(all=TRUE))
pkgName <- "ternaryplot"
-pkgDir <- "D:/Users/julienm/Documents/_WORKS/_PROJECTS/r_packages/ternaryplot/pkg"
+pkgDir <- "D:/Users/julienm/Documents/_WORKS/_PROJECTS/r_packages/soiltexture/pkg"
-library( "inlinedocs" )
+library( "roxygen2" )
# Source some utility functions
@@ -14,7 +15,7 @@
pkgDescription(
pkgName = pkgName,
pkgDir = pkgDir,
- pkgVersion = "0.1.1",
+ pkgVersion = "0.1.2",
pkgDepends = "methods",
pkgSuggests = NULL,
RVersion = NULL
More information about the Soiltexture-commits
mailing list