[Dplr-commits] r985 - in pkg/dplR: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu May 28 01:12:36 CEST 2015
Author: andybunn
Date: 2015-05-28 01:12:36 +0200 (Thu, 28 May 2015)
New Revision: 985
Modified:
pkg/dplR/ChangeLog
pkg/dplR/DESCRIPTION
pkg/dplR/R/crn.plot.R
pkg/dplR/man/crn.plot.Rd
Log:
Added xlab and ylab to crn.plot()
Modified: pkg/dplR/ChangeLog
===================================================================
--- pkg/dplR/ChangeLog 2015-05-26 13:47:36 UTC (rev 984)
+++ pkg/dplR/ChangeLog 2015-05-27 23:12:36 UTC (rev 985)
@@ -1,5 +1,12 @@
* CHANGES IN dplR VERSION 1.6.3
+File: crn.plot.R
+-------------
+
+- Added default x and y labels to plot. It would be better to use match.call()
+ to check to see if xlab and ylab were passed in as dots but it is a very
+ cumbersome bit of code for only a little difference to the user.
+
File: spag.plot.R
--------------
Modified: pkg/dplR/DESCRIPTION
===================================================================
--- pkg/dplR/DESCRIPTION 2015-05-26 13:47:36 UTC (rev 984)
+++ pkg/dplR/DESCRIPTION 2015-05-27 23:12:36 UTC (rev 985)
@@ -3,7 +3,7 @@
Type: Package
Title: Dendrochronology Program Library in R
Version: 1.6.3
-Date: 2015-05-26
+Date: 2015-05-27
Authors at R: c(person("Andy", "Bunn", role = c("aut", "cph",
"cre", "trl"), email = "andy.bunn at wwu.edu"), person("Mikko",
"Korpela", role = c("aut", "trl")), person("Franco", "Biondi",
Modified: pkg/dplR/R/crn.plot.R
===================================================================
--- pkg/dplR/R/crn.plot.R 2015-05-26 13:47:36 UTC (rev 984)
+++ pkg/dplR/R/crn.plot.R 2015-05-27 23:12:36 UTC (rev 985)
@@ -8,6 +8,7 @@
crn.lwd=1, spline.lwd=1.5,
abline.pos=1, abline.col='black',
abline.lty=1, abline.lwd=1,
+ xlab="Time",ylab="RWI",
...) {
if(!is.data.frame(crn)) stop("'crn' must be a data.frame")
@@ -33,7 +34,7 @@
nyrs2 <- nyrs
for(i in seq_len(nCrn)){
spl <- crn[[i]]
- plot(yr.vec, spl, type="n",axes=FALSE,...)
+ plot(yr.vec, spl, type="n",axes=FALSE,xlab=xlab,ylab=ylab,...)
if(sd.exist) {
par(new=TRUE)
plot(yr.vec, samp.depth, type="n",
Modified: pkg/dplR/man/crn.plot.Rd
===================================================================
--- pkg/dplR/man/crn.plot.Rd 2015-05-26 13:47:36 UTC (rev 984)
+++ pkg/dplR/man/crn.plot.Rd 2015-05-27 23:12:36 UTC (rev 985)
@@ -14,7 +14,8 @@
samp.depth.border.col='grey80',
crn.lwd=1,spline.lwd=1.5,
abline.pos=1,abline.col='black',
- abline.lty=1,abline.lwd=1,...)
+ abline.lty=1,abline.lwd=1,
+ xlab="Time",ylab="RWI",...)
\method{plot}{crn}(x, ...)
@@ -45,6 +46,8 @@
\item{abline.col}{ color for the reference abline (if added) }
\item{abline.lty}{ line type the reference abline (if added) }
\item{abline.lwd}{ line width for the reference abline (if added)}
+ \item{xlab}{ default label for x axis }
+ \item{ylab}{ default label for y axis }
\item{\dots}{ Additional arguments to pass to \code{\link{plot}} }
}
\details{
@@ -59,18 +62,18 @@
\examples{library(graphics)
library(utils)
data(cana157)
-crn.plot(cana157,xlab='Year',ylab='RWI')
-plot(cana157,xlab='Year',ylab='RWI', main='Twisted Tree Heartrot Hill')
+crn.plot(cana157)
+plot(cana157, main='Twisted Tree Heartrot Hill')
# with added spline
-crn.plot(cana157,add.spline=TRUE, nyrs=32, xlab='Year',ylab='RWI')
+crn.plot(cana157,add.spline=TRUE, nyrs=32)
## Without sample depth
cana157.mod <- cana157
cana157.mod$samp.depth <- NULL
-crn.plot(cana157.mod, add.spline = TRUE, xlab='Year',ylab='RWI')
+crn.plot(cana157.mod, add.spline = TRUE)
## A raw ring-width chronology
data(ca533)
ca533.raw.crn <- chron(ca533, prefix = "CAM", prewhiten=TRUE)
-plot(ca533.raw.crn,abline.pos=NULL,ylab='mm',xlab='Year')
+plot(ca533.raw.crn,abline.pos=NULL,ylab='mm')
\dontrun{
# not pretty - but illustrates the coloring options
More information about the Dplr-commits
mailing list