[Soiltexture-commits] r103 - / pkg/ternaryplot prepare

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 28 17:50:32 CET 2014


Author: jmoeys
Date: 2014-03-28 17:50:31 +0100 (Fri, 28 Mar 2014)
New Revision: 103

Added:
   prepare/plotParameters-plot.xls
   prepare/plotParameters-ternary.xls
   soiltexture_1_RCMDBUILD.bat
   soiltexture_2_RCMDcheck_noexamples.bat
   soiltexture_2_RCMDcheck_notests_novignette.bat
   soiltexture_3_RCMDINSTALL_build.BAT
Removed:
   1_RCMDBUILD.bat
   1_RCMDBUILD.sh
   2_RCMDcheck_noexamples.bat
   2_RCMDcheck_noexamples.sh
   2_RCMDcheck_notests_novignette.bat
   2_RCMDcheck_notests_novignette.sh
   3_RCMDINSTALL_build.BAT
   3_RCMDINSTALL_build.sh
   ternaryplot_1_RCMDbuild_novignette.bat
   ternaryplot_2_RCMDcheck_notests_noexamples_novignettes.bat
   ternaryplot_vignette_compile.R
Modified:
   packageUtilities.R
   pkg/ternaryplot/REVISION
   ternaryplot_1_RCMDbuild.bat
   ternaryplot_Document.R
   ternaryplot_ToDoList.TXT
Log:
Finlise conversion of ternaryplot from S4 to S3

Deleted: 1_RCMDBUILD.bat
===================================================================
--- 1_RCMDBUILD.bat	2014-03-28 16:47:09 UTC (rev 102)
+++ 1_RCMDBUILD.bat	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,7 +0,0 @@
-set pkgname=soiltexture
-
-cd /D "%rPackagesDir%\%pkgname%\pkg" 
-
-R CMD build --compact-vignettes="gs+qpdf" --md5 %pkgname% 
-
-pause

Deleted: 1_RCMDBUILD.sh
===================================================================
--- 1_RCMDBUILD.sh	2014-03-28 16:47:09 UTC (rev 102)
+++ 1_RCMDBUILD.sh	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,6 +0,0 @@
-# cd "/home/jules/Documents/_WORK/R_PACKAGES/soiltexture/pkg/"
-cd "/home/jmoeys/Documents/_WORK/R_PACKAGES/soiltexture/pkg/"
-R CMD build --compact-vignettes soiltexture 
-echo "press any key to continue"; read line
-
-

Deleted: 2_RCMDcheck_noexamples.bat
===================================================================
--- 2_RCMDcheck_noexamples.bat	2014-03-28 16:47:09 UTC (rev 102)
+++ 2_RCMDcheck_noexamples.bat	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,9 +0,0 @@
-set pkgname=soiltexture
-
-cd /D "%rPackagesDir%\%pkgname%\pkg" 
-
-R CMD check --no-examples --as-cran %pkgname%_1.2.13.tar.gz
-
- at REM --as-cran 
-
-pause

Deleted: 2_RCMDcheck_noexamples.sh
===================================================================
--- 2_RCMDcheck_noexamples.sh	2014-03-28 16:47:09 UTC (rev 102)
+++ 2_RCMDcheck_noexamples.sh	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,6 +0,0 @@
-# cd "/home/jules/Documents/_WORK/R_PACKAGES/soiltexture/pkg/"
-cd "/home/jmoeys/Documents/_WORK/R_PACKAGES/soiltexture/pkg/"
-R CMD check --no-tests --as-cran soiltexture 
-echo "press any key to continue"; read line
-
-

Deleted: 2_RCMDcheck_notests_novignette.bat
===================================================================
--- 2_RCMDcheck_notests_novignette.bat	2014-03-28 16:47:09 UTC (rev 102)
+++ 2_RCMDcheck_notests_novignette.bat	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,9 +0,0 @@
-set pkgname=soiltexture
-
-cd /D "%rPackagesDir%\%pkgname%\pkg" 
-
-R CMD check --no-tests --no-examples --no-vignettes %pkgname% 
-
-REM --as-cran 
-
-pause

Deleted: 2_RCMDcheck_notests_novignette.sh
===================================================================
--- 2_RCMDcheck_notests_novignette.sh	2014-03-28 16:47:09 UTC (rev 102)
+++ 2_RCMDcheck_notests_novignette.sh	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,5 +0,0 @@
-cd "/home/jules/Documents/_WORK/R_PACKAGES/soiltexture/pkg"
-R CMD check --no-tests --no-vignettes --as-cran soiltexture 
-echo "press any key to continue"; read line
-
-

Deleted: 3_RCMDINSTALL_build.BAT
===================================================================
--- 3_RCMDINSTALL_build.BAT	2014-03-28 16:47:09 UTC (rev 102)
+++ 3_RCMDINSTALL_build.BAT	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,7 +0,0 @@
-set pkgname=soiltexture
-
-cd /D "%rPackagesDir%\%pkgname%\pkg" 
-
-R CMD INSTALL --build --compile-both --compact-docs --byte-compile %pkgname%_1.2.13.tar.gz
-
-pause

Deleted: 3_RCMDINSTALL_build.sh
===================================================================
--- 3_RCMDINSTALL_build.sh	2014-03-28 16:47:09 UTC (rev 102)
+++ 3_RCMDINSTALL_build.sh	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,7 +0,0 @@
-# cd "/home/jules/Documents/_WORK/R_PACKAGES/soiltexture/pkg/"
-cd "/home/jmoeys/Documents/_WORK/R_PACKAGES/soiltexture/pkg/"
-R CMD INSTALL --build --compact-docs --byte-compile soiltexture 
-echo "press any key to continue"; read line
-
-
-

Modified: packageUtilities.R
===================================================================
--- packageUtilities.R	2014-03-28 16:47:09 UTC (rev 102)
+++ packageUtilities.R	2014-03-28 16:50:31 UTC (rev 103)
@@ -62,10 +62,14 @@
 ### Vector of character strings. Names of the packages that needs to be installed
 ### prior to the package installation. NULL if none
 
- pkgSuggests=NULL
+ pkgSuggests=NULL,
 ### Vector of character string. Names of the packages that needs 
 ### to be cited in the "Suggests" field. NULL if none
 
+ pkgImports=NULL
+### Vector of character string. Names of the packages that needs 
+### to be cited in the "Imports" field. NULL if none
+
 ){  
     # Read the file DESCRIPTION 
     desc <- readLines( 
@@ -148,16 +152,51 @@
         sep = "" 
     )   
     
-    if( any( desc.sel2 ) )
-    {   
-        desc[ desc.sel2 ] <- suggests.txt 
+    if( is.null( pkgSuggests ) ){ 
+        desc <- desc[ !desc.sel2 ]
+        
     }else{ 
-        desc <- c(
-            desc, 
-            suggests.txt 
-        )   
+        if( any( desc.sel2 ) ){   
+            desc[ desc.sel2 ] <- suggests.txt 
+        }else{ 
+            desc <- c(
+                desc, 
+                suggests.txt 
+            )   
+        }   
     }   
     
+    
+    
+    # Find where the "Imports:" line is
+    desc.sel2 <- substr( 
+        x     = desc, 
+        start = 1, 
+        stop  = nchar("Imports:")  
+    ) == "Imports:"
+    
+    imports.txt <- paste( 
+        "Imports: ", 
+        paste( pkgImports, collapse = ", " ), 
+        sep = "" 
+    )   
+    if( is.null( pkgImports ) ){ 
+        desc <- desc[ !desc.sel2 ]
+        
+    }else{ 
+        if( any( desc.sel2 ) )
+        {   
+            desc[ desc.sel2 ] <- imports.txt 
+        }else{ 
+            desc <- c(
+                desc, 
+                imports.txt 
+            )   
+        }   
+    }   
+    
+    
+    
     # Write again the description file:
     desc <- writeLines( 
         con = file.path( 

Modified: pkg/ternaryplot/REVISION
===================================================================
--- pkg/ternaryplot/REVISION	2014-03-28 16:47:09 UTC (rev 102)
+++ pkg/ternaryplot/REVISION	2014-03-28 16:50:31 UTC (rev 103)
@@ -1 +1 @@
-95:101M
+95:102M

Added: prepare/plotParameters-plot.xls
===================================================================
(Binary files differ)


Property changes on: prepare/plotParameters-plot.xls
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: prepare/plotParameters-ternary.xls
===================================================================
(Binary files differ)


Property changes on: prepare/plotParameters-ternary.xls
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Copied: soiltexture_1_RCMDBUILD.bat (from rev 98, 1_RCMDBUILD.bat)
===================================================================
--- soiltexture_1_RCMDBUILD.bat	                        (rev 0)
+++ soiltexture_1_RCMDBUILD.bat	2014-03-28 16:50:31 UTC (rev 103)
@@ -0,0 +1,7 @@
+set pkgname=soiltexture
+
+cd /D "%rPackagesDir%\%pkgname%\pkg" 
+
+R CMD build --compact-vignettes="gs+qpdf" --md5 %pkgname% 
+
+pause

Copied: soiltexture_2_RCMDcheck_noexamples.bat (from rev 97, 2_RCMDcheck_noexamples.bat)
===================================================================
--- soiltexture_2_RCMDcheck_noexamples.bat	                        (rev 0)
+++ soiltexture_2_RCMDcheck_noexamples.bat	2014-03-28 16:50:31 UTC (rev 103)
@@ -0,0 +1,9 @@
+set pkgname=soiltexture
+
+cd /D "%rPackagesDir%\%pkgname%\pkg" 
+
+R CMD check --no-examples --as-cran %pkgname%_1.2.13.tar.gz
+
+ at REM --as-cran 
+
+pause

Copied: soiltexture_2_RCMDcheck_notests_novignette.bat (from rev 95, 2_RCMDcheck_notests_novignette.bat)
===================================================================
--- soiltexture_2_RCMDcheck_notests_novignette.bat	                        (rev 0)
+++ soiltexture_2_RCMDcheck_notests_novignette.bat	2014-03-28 16:50:31 UTC (rev 103)
@@ -0,0 +1,9 @@
+set pkgname=soiltexture
+
+cd /D "%rPackagesDir%\%pkgname%\pkg" 
+
+R CMD check --no-tests --no-examples --no-vignettes %pkgname% 
+
+REM --as-cran 
+
+pause

Copied: soiltexture_3_RCMDINSTALL_build.BAT (from rev 97, 3_RCMDINSTALL_build.BAT)
===================================================================
--- soiltexture_3_RCMDINSTALL_build.BAT	                        (rev 0)
+++ soiltexture_3_RCMDINSTALL_build.BAT	2014-03-28 16:50:31 UTC (rev 103)
@@ -0,0 +1,7 @@
+set pkgname=soiltexture
+
+cd /D "%rPackagesDir%\%pkgname%\pkg" 
+
+R CMD INSTALL --build --compile-both --compact-docs --byte-compile %pkgname%_1.2.13.tar.gz
+
+pause

Modified: ternaryplot_1_RCMDbuild.bat
===================================================================
--- ternaryplot_1_RCMDbuild.bat	2014-03-28 16:47:09 UTC (rev 102)
+++ ternaryplot_1_RCMDbuild.bat	2014-03-28 16:50:31 UTC (rev 103)
@@ -2,6 +2,8 @@
 
 cd /D "%rPackagesDir%\soiltexture\pkg" 
 
+svnversion > %pkgname%\REVISION
+
 R CMD build --compact-vignettes="gs+qpdf" %pkgname% 
 
 pause

Deleted: ternaryplot_1_RCMDbuild_novignette.bat
===================================================================
--- ternaryplot_1_RCMDbuild_novignette.bat	2014-03-28 16:47:09 UTC (rev 102)
+++ ternaryplot_1_RCMDbuild_novignette.bat	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,7 +0,0 @@
-set pkgname=ternaryplot
-
-cd /D "%rPackagesDir%\%pkgname%\pkg" 
-
-R CMD build --no-vignettes --compact-vignette="gs" %pkgname% 
-
-pause

Deleted: ternaryplot_2_RCMDcheck_notests_noexamples_novignettes.bat
===================================================================
--- ternaryplot_2_RCMDcheck_notests_noexamples_novignettes.bat	2014-03-28 16:47:09 UTC (rev 102)
+++ ternaryplot_2_RCMDcheck_notests_noexamples_novignettes.bat	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,9 +0,0 @@
-set pkgname=ternaryplot
-
-cd /D "%rPackagesDir%\%pkgname%\pkg" 
-
-R CMD check --no-tests --no-examples --no-vignettes %pkgname%
-
- at REM --as-cran 
-
-pause

Modified: ternaryplot_Document.R
===================================================================
--- ternaryplot_Document.R	2014-03-28 16:47:09 UTC (rev 102)
+++ ternaryplot_Document.R	2014-03-28 16:50:31 UTC (rev 103)
@@ -15,9 +15,10 @@
 pkgDescription( 
     pkgName     = pkgName, 
     pkgDir      = pkgDir, 
-    pkgVersion  = "0.1.2", 
-    pkgDepends  = "methods", 
+    pkgVersion  = "0.3.0", 
+    pkgDepends  = c( "sp", "MASS" ), 
     pkgSuggests = NULL, 
+    pkgImports  = NULL, 
     RVersion    = NULL   
 )   
 

Modified: ternaryplot_ToDoList.TXT
===================================================================
--- ternaryplot_ToDoList.TXT	2014-03-28 16:47:09 UTC (rev 102)
+++ ternaryplot_ToDoList.TXT	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,38 +1,146 @@
-Create functions
 
-    blrLabels to set the labels
+aa01-ternaryplot-options.R
     
-    ternaryPlot()
-        Add ticks labels
-        DONE: Add arrows
-        fix axis arrows labels pos and srt 
-        
-    ternaryAxis() that bundles ticks, ticks labels, 
-        arrows and arrows label
-        
-        fix axis arrows labels pos and srt 
+    tpPar
+    getTpPar
     
-    DONE: ternaryPoints() to plot points on ternary plots
+    .tpParList          (environment)
+    tpParList           (environment)
     
-    ternaryLines() to plot lines on ternary plots
+aa02-ternaryplot-classes.R
     
-    DONE: ternarySegment() to plot segments on ternary plot
+    ternaryCheck        ternaryGeometry ternaryVariables ternarySystem
+    createTernaryGeometry
+    createTernaryVariables
+    createTernarySystem
+
+aa03-ternaryplot-classes-utility.R
+
+    blrNames            ternaryVariables ternarySystem
+    blrNames<-          ternaryVariables ternarySystem
+    blrLabels           ternaryVariables ternarySystem
+    blrLabels<-         ternaryVariables ternarySystem
+    blrClock            ternaryGeometry ternarySystem
+    blrClock<-          ternaryGeometry ternarySystem
+    fracSum             ternaryGeometry ternarySystem
+    fracSum<-           ternaryGeometry ternarySystem
+    tlrAngles           ternaryGeometry ternarySystem
+    tlrAngles<-         ternaryGeometry ternarySystem
+    ternaryGeometry     ternarySystem
+    ternaryGeometry<-   ternarySystem
+    ternaryVariables    ternarySystem
+    ternaryVariables<-  ternarySystem
+
+aa04-ternarySystems.R
+
+    ternarySystemEnv    (environment)
+    getTernarySystem
+    listTernarySystem
     
-    DONE: ternaryArrows() to plot arrows on a ternary plot
+onAttach.R
     
-    ternaryPolygons() to plot polygons on ternary plots
+    .onAttach
+
+ternaryplot.R
     
-    ternaryClass() that plot ternary classes (polygons + labels)
+    ternaryData         ternarySystem character missing     (includes tests)
     
-    ternaryClassify() that classify according to ternary classes
+    .setTernarySystem
+    ternaryWindow       ternarySystem character missing
+    ternaryBox          ternarySystem
+    ternaryPoints       data.frame matrix   >> make function of "ternarySystem character" (+ internal 'data' handling)
+    ternarySegments     data.frame matrix   >> make function of "ternarySystem character" (+ internal 'data' handling)
+    ternaryArrows       data.frame          >> make function of "ternarySystem character" (+ internal 'data' handling)
+    .ternaryGridBase    ternarySystem
+    .ternaryTicks       ternarySystem
+    ternaryGrid         ternarySystem
     
+    ternaryPlot         data.frame matrix   >> make function of "ternarySystem character" (+ internal 'data' handling)
+        TO DO: type = "p" points, "l" lines, "b" both, "c" counts, 
+               "de" density, "di" distance (contour chosen via "...")
+        TO DO: facet = {category}, fCol, fPch, zCol, zCex
+        TO DO: make axes ticks depend on axTicks()
+        TO DO: make arrows and arrows labels distance from the plot a function of margin size using par("plt") 
+               and *backward* calculating the label position
+               
+               (1) regression between plt and usr (plt -> usr) for plotting points into margin, in X-axis margin (Y coordinates!)
+               (2) convert between axis margin line par( "mgp" )[2] to relative 0-1 coordinates of the margin, using par( "mar" )
+                   (= number of lines in the margin). Summary mgp -> 0-1 coords -> plt -> XY (usr)
+                   transfMgpTo0_1() transf0_1ToPlt() transfPltToXY() 
+               (3) converting from X-Y to ternary coordinates with ternary2xy() 
+                   that gives the Y-distance between the triangle frame and the axis labels
+               (4) Using that distance to position the other two axis arrows and labels
     
+    ternaryLims         data.frame matrix       >> make function of "ternarySystem character" (+ internal 'data' handling)
+    deg2rad             
+    ternary2xy              data.frame matrix   >> make function of "ternarySystem character" (+ internal 'data' handling)
+    ternaryClockSwitch  data.frame matrix       >> make function of "ternarySystem character" (+ internal 'data' handling)
+    ternaryText         data.frame matrix       >> make function of "ternarySystem character" (+ internal 'data' handling)
+    .ternaryAxisArrowsBase ternarySystem
+    .ternaryAxisArrows  ternarySystem
+    
+    TO DO: ternaryLines ternarySystem 
+    
+    TO DO: ternaryPolygon ternarySystem 
+    TO DO: ternaryClasses ternarySystem         >> draw ternary classification systems
+    TO DO: ternaryClassify ternarySystem        >> Same as ternaryOver
+    
+    TO DO: ternaryDensity ternarySystem 
+    TO DO: ternaryBin ternarySystem 
+    TO DO: ternaryDistance mahalanobis
+    TO DO: ternaryContour ternaryDensity ternaryBin 
+    
+    TO DO: ternaryNormalise ternarySystem 
+    
+    TO DO: as.data.frame ternarySystem          >> what = "vertices" or "classes"
+    
+    TO DO: ternaryTheme( "default" )    Switch between themes
+    TO DO: more graphical parameters from par() can be overwritten with tpPar()
+    
+    TO DO: ternary2SpatialPointsDataFrame ternarySystem+data.frame or ternaryData or ternarySystem (includes extra columns)
+    TO DO: ternary2SpatialPolygonsDataFrame ternarySystem or ternaryPolygons (classes)
+    
+    TO DO: ternaryOver      >> ternary version of sp::over
+    TO DO: ternaryAggregate >> ternary version of sp::aggregate
+    
+    TO DO: use ternaryGrid (ternaryPolygons) + ternaryAggregate to calculate summary statistics
+    
+    
+Examples:
+    
+    Ternary Diagrams of Shepard and Pejrup:
+    http://rgm3.lab.nig.ac.jp/RGM/R_rdfile?f=rysgran/man/rysgran.ternary.Rd&d=R_CC
+    http://www.mgs.md.gov/coastal_geology/shepards.html
+    
+    QAPF diagram:
+    http://en.wikipedia.org/wiki/QAPF_diagram
+    
+    http://en.wikipedia.org/wiki/De_Finetti_diagram
 
-
-### Classes
-
-class texturePlot
-    ternarySystem 
-    silt-sand limit
-
-NB: particle size transformations shall be done *before* plotting.
+Graphical parameters:
+    
+    See plotParameters.xls
+    
+    Notes:
+    Number segments in arrows   yes tpPar("arrow.seg")
+    Margins                     no  tpPar("mar")
+    
+    type = 
+        "n"     nothing
+        "p"     points (ternaryPoints) or text if !is.null(labels) (ternaryText)
+        "l"     lines (ternaryLines) 
+        "b"     both points and lines
+        "d"     density (ternaryGrid + ternaryDensity)
+        "c"     counts (ternaryGrid + ternaryCounts)
+    
+    facet      Factor variable for plot facets (sub-plots) 
+    
+    extra      A list of parameters passed to ternaryPoints or ternaryLines
+        fPch        Factor variable for point symbols 
+        fCol        Factor variable for point or line colors
+        fLty        Factor variable for line type
+        cCol        Continuous variable for point or line colors    use cut( x, breaks = 5 )
+        cCex        Continuous variable for point expansion         use cut( x, breaks = 5 )
+        position    Legend position(s) (if several)
+    
+    
\ No newline at end of file

Deleted: ternaryplot_vignette_compile.R
===================================================================
--- ternaryplot_vignette_compile.R	2014-03-28 16:47:09 UTC (rev 102)
+++ ternaryplot_vignette_compile.R	2014-03-28 16:50:31 UTC (rev 103)
@@ -1,26 +0,0 @@
-rm(list=ls(all=TRUE)) 
-pkg.name <- "template" 
-rootDir  <- "C:/_R_PACKAGES" 
-
-
-
-setwd( file.path( rootDir, pkg.name, "pkg", pkg.name, "inst/doc" ) ) 
-
-Stangle( paste( pkg.name, "vignette.Rnw", sep = "_" ) 
-
-Sweave( paste( pkg.name, "vignette.Rnw", sep = "_" ) 
-
-msg <- tools::texi2dvi( 
-    file        = paste( pkg.name, "vignette.tex", sep = "_", 
-    pdf         = TRUE, 
-    clean       = TRUE, 
-    texinputs   = getwd() 
-)   # 
-
-file.remove( list.files( getwd(), "\\.tex$", full.names = TRUE ) )
-file.remove( list.files( getwd(), "\\.bib.bak$", full.names = TRUE ) )
-file.remove( list.files( getwd(), "\\.R$", full.names = TRUE ) )
-
-library("tools")
-res <- compactPDF( paths = getwd(), gs_quality = "ebook" ) # paste(sep="",file.name.root,".pdf") 
-res 



More information about the Soiltexture-commits mailing list