Skip to content

Commit cedfbdb

Browse files
committed
6 CRAN related files plus synch smooth.surp.Rd
1 parent e7e24cb commit cedfbdb

9 files changed

+78
-137
lines changed

fda_release_to_CRAN.R

-54
This file was deleted.

inst/.DS_Store

0 Bytes
Binary file not shown.

man/CRAN.Rd

+19-21
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
compute time constraints with CRAN tests.
1010
}
1111
\usage{
12-
CRAN(CRAN_pattern, n_R_CHECK4CRAN)
12+
CRAN(CRAN_pattern, n_R_CHECK4CRAN)
1313
}
1414
\arguments{
1515
\item{CRAN_pattern}{
@@ -55,26 +55,24 @@ CRAN(CRAN_pattern, n_R_CHECK4CRAN)
5555
\code{\link{Sys.getenv}}
5656
}
5757
\examples{
58-
% Look in fda-ex.Rout
59-
% for the results from R CMD check
60-
% Modified defaults were tested with environment variables
61-
% _CRAN_pattern_ = 'A' and _n_R_CHECK4CRAN_ = '10'
62-
% 'R CMD check' found 26 matches and CRAN() returned TRUE
63-
cran <- CRAN()
64-
str(cran)
65-
gete <- attr(cran, 'Sys.getenv')
66-
(ngete <- names(gete))
67-
68-
iget <- grep('^_', names(gete))
69-
gete[iget]
70-
71-
if(!CRAN()) {
72-
if(CRAN()){
73-
stop('CRAN')
74-
} else {
75-
stop('NOT CRAN')
76-
}
77-
}
58+
# Look in fda-ex.R
59+
# for the results from R CMD check
60+
# Modified defaults were tested with environment variables
61+
# _CRAN_pattern_ = 'A' and _n_R_CHECK4CRAN_ = '10'
62+
# 'R CMD check' found 26 matches and CRAN() returned TRUE
63+
cran <- CRAN()
64+
str(cran)
65+
gete <- attr(cran, 'Sys.getenv')
66+
(ngete <- names(gete))
67+
iget <- grep('^_', names(gete))
68+
gete[iget]
69+
# if (!CRAN()) {
70+
# if (CRAN()) {
71+
# stop("CRAN")
72+
# } else {
73+
# stop("NOT CRAN")
74+
# }
75+
# }
7876
}
7977
\keyword{environment}
8078

man/as.array3.Rd

+22-21
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,31 @@ as.array3(x)
4545
\code{\link{checkDims3}}
4646
}
4747
\examples{
48-
##
49-
## vector -> array
50-
##
51-
as.array3(c(a=1, b=2))
48+
##
49+
## vector -> array
50+
##
51+
as.array3(c(a=1, b=2))
5252

53-
##
54-
## matrix -> array
55-
##
56-
as.array3(matrix(1:6, 2))
57-
as.array3(matrix(1:6, 2, dimnames=list(letters[1:2], LETTERS[3:5])))
53+
##
54+
## matrix -> array
55+
##
56+
57+
as.array3(matrix(1:6, 2))
58+
as.array3(matrix(1:6, 2, dimnames=list(letters[1:2], LETTERS[3:5])))
5859

59-
##
60-
## array -> array
61-
##
62-
as.array3(array(1:6, 1:3))
60+
##
61+
## array -> array
62+
##
63+
64+
as.array3(array(1:6, 1:3))
6365

64-
##
65-
## 4-d array
66-
##
67-
if(!CRAN()) {
68-
as.array3(array(1:24, 1:4))
69-
Error in as.array3(array(1:24, 1:4)) :
70-
length(dim(array(1:24, 1:4)) = 4 > 3
71-
}
66+
##
67+
## 4-d array
68+
##
69+
70+
if(!CRAN()) {
71+
as.array3(array(1:24, 1:4))
72+
}
7273
}
7374
\keyword{utilities}
7475

man/fd.Rd

+2-6
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ oldpar <- par(no.readonly=TRUE)
9797
## The simplest b-spline basis: order 1, degree 0, zero interior knots:
9898
## a single step function
9999
##
100-
bspl1.1 <- create.bspline.basis(norder=1, breaks=0:1)
100+
bspl1.1 <- create.bspline.basis(norder=1, breaks=0:1)
101101
fd.bspl1.1 <- fd(0, basisobj=bspl1.1)
102102

103103
fd.bspl1.1a <- fd(basisobj=bspl1.1)
@@ -107,11 +107,7 @@ all.equal(fd.bspl1.1, fd.bspl1.1a)
107107
# TRUE
108108

109109
if(!CRAN()) {
110-
fd.bspl1.1b <- fd(0)
111-
Error in fd(0) :
112-
Number of coefficients does not match number of basis functions.
113-
114-
... because fd by default wants to create a cubic spline
110+
fd.bspl1.1b <- fd(0)
115111
}
116112

117113
##

man/fda-package.Rd

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
##
5151
if(!CRAN()){
5252
scriptsDir <- system.file('scripts', package='fda')
53-
Rscripts <- dir(scriptsDir, full.names=TRUE, pattern='R$')
54-
fdarm <- grep('fdarm', Rscripts, value=TRUE)
55-
chapters <- length(fdarm)
53+
Rscripts <- dir(scriptsDir, full.names=TRUE, pattern='R$')
54+
fdarm <- grep('fdarm', Rscripts, value=TRUE)
55+
chapters <- length(fdarm)
5656
# NOTE: If R fails in any of these scripts,
5757
# this for loop will not end normally,
5858
# and the abnormal termination will be displayed:

man/norder.Rd

+21-21
Original file line numberDiff line numberDiff line change
@@ -46,35 +46,35 @@ norder(x, ...)
4646
\code{\link{create.bspline.basis}}
4747
}
4848
\examples{
49-
bspl1.1 <- create.bspline.basis(norder=1, breaks=0:1)
49+
bspl1.1 <- create.bspline.basis(norder=1, breaks=0:1)
5050

51-
stopifnot(norder(bspl1.1)==1)
51+
stopifnot(norder(bspl1.1)==1)
5252

53-
stopifnot(norder(fd(0, basisobj=bspl1.1))==1)
53+
stopifnot(norder(fd(0, basisobj=bspl1.1))==1)
5454

55-
stopifnot(norder(fd(rep(0,4)))==4)
55+
stopifnot(norder(fd(rep(0,4)))==4)
5656

57-
stopifnot(norder(list(fd(rep(0,4))))==4)
58-
\dontrun{
59-
norder(list(list(fd(rep(0,4)))))
60-
Error in norder.default(list(list(fd(rep(0, 4))))) :
61-
input is not a 'basisfd' object and does not have a 'basisfd'
62-
component.
63-
}
57+
stopifnot(norder(list(fd(rep(0,4))))==4)
58+
\dontrun{
59+
norder(list(list(fd(rep(0,4)))))
60+
Error in norder.default(list(list(fd(rep(0, 4))))) :
61+
input is not a 'basisfd' object and does not have a 'basisfd'
62+
component.
63+
}
6464

65-
stopifnot(norder(create.bspline.basis(norder=1, breaks=c(0,.5, 1))) == 1)
65+
stopifnot(norder(create.bspline.basis(norder=1, breaks=c(0,.5, 1))) == 1)
6666

67-
stopifnot(norder(create.bspline.basis(norder=2, breaks=c(0,.5, 1))) == 2)
67+
stopifnot(norder(create.bspline.basis(norder=2, breaks=c(0,.5, 1))) == 2)
6868

69-
# Defaut B-spline basis: Cubic spline: degree 3, order 4,
70-
# 21 breaks, 19 interior knots.
71-
stopifnot(norder(create.bspline.basis()) == 4)
69+
# Default B-spline basis: Cubic spline: degree 3, order 4,
70+
# 21 breaks, 19 interior knots.
71+
stopifnot(norder(create.bspline.basis()) == 4)
7272

73-
if (!CRAN()) {
74-
norder(create.fourier.basis(c(0,12) ))
75-
Error in norder.bspline(x) :
76-
object x is of type = fourier; 'norder' is only defined for type = 'bsline'
77-
}
73+
if (!CRAN()) {
74+
norder(create.fourier.basis(c(0,12) ))
75+
# Error in norder.bspline(x) :
76+
# object x is of type = fourier; 'norder' is only defined for type = 'bspline'
77+
}
7878

7979
}
8080
\keyword{smooth}

man/plot.fd.Rd

+9-9
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ daytempfd <- with(CanadianWeather, smooth.basis(day.5,
125125
# plot all the temperature functions for the monthly weather data
126126
plot(daytempfd, main="Temperature Functions")
127127

128-
if (!CRAN)) {
129-
# To plot one at a time:
130-
# The following pauses to request page changes.
131-
\dontshow{
132-
# (Without 'dontrun', the package build process
133-
# might encounter problems with the par(ask=TRUE)
134-
# feature.)
135-
}
136-
plot(daytempfd, ask=TRUE)
128+
if (!CRAN()) {
129+
# To plot one at a time:
130+
# The following pauses to request page changes.
131+
\dontshow{
132+
# (Without 'dontrun', the package build process
133+
# might encounter problems with the par(ask=TRUE)
134+
# feature.)
135+
}
136+
plot(daytempfd, ask=TRUE)
137137
}
138138

139139
##

man/smooth.surp.Rd

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
M-1 dimensional surprisal subspace that is within the space of non-negative M-dimensional vectors.
1111
}
1212
\usage{
13-
smooth.surp(argvals, Wbin, Bmat0, WfdPar, wtvec=NULL, conv=1e-4,
13+
smooth.surp(argvals, y, Bmat0, WfdPar, wtvec=NULL, conv=1e-4,
1414
iterlim=50, dbglev=0)
1515
}
1616
\arguments{
@@ -21,7 +21,7 @@ smooth.surp(argvals, Wbin, Bmat0, WfdPar, wtvec=NULL, conv=1e-4,
2121
you will need to run this function inside one or more loops,
2222
smoothing each curve separately.
2323
}
24-
\item{Wbin}{
24+
\item{y}{
2525
A \code{nbin} by \code{M_i} matrix of surprisal values to be fit.
2626
}
2727
\item{Bmat0}{A \code{Wnbasis} by \code{M_i - 1} matrix containing starting

0 commit comments

Comments
 (0)