Skip to content

Commit f89f12f

Browse files
James RamsayJames Ramsay
authored andcommitted
fix comparison of class to string
1 parent 10d8b56 commit f89f12f

9 files changed

+4
-113
lines changed

R/as.POSIXct1970.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ as.POSIXct1970 <- function(x, tz="GMT", ...){
22
#
33
if(!is.numeric(x)){
44
Px <- try(as.POSIXct(x, tz=tz, ...))
5-
if(class(Px)[1]=='try-error'){
5+
if(inherits(Px,'try-error')){
66
nx <- length(x)
77
Px <- rep(as.POSIXct1970(0), nx)
88
}

R/checkLogicalInteger.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ checkLogical <- function(x, length., warnOnly=FALSE) {
2828
##
2929
## 3. check class(x)
3030
##
31-
if(class(x) != 'logical')
31+
if(!inherits(x, 'logical'))
3232
good <- (good & onExit('class(', xName, ') = ', class(x),
3333
"; should be 'logical'"))
3434
##

R/cor.fd.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ cor.fd <- function(evalarg1, fdobj1, evalarg2=evalarg1, fdobj2=fdobj1)
1717
##
1818
## 2. Evaluate var1 at evalarg1
1919
##
20-
print(class(var1))
2120
evalVar1 <- eval.bifd(evalarg1, evalarg1, var1)
2221
##
2322
## 3. If missing(fdobj2) convert evalVar1 to correlations

R/create.bspline.basis.R

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,6 @@ create.bspline.basis <- function (rangeval=NULL, nbasis=NULL,
114114

115115
type <- "bspline"
116116

117-
# if (nargs()==0) {
118-
# rangeval <- c(0,1)
119-
# nbasis <- 2
120-
# params <- NULL
121-
# dropind <- NULL
122-
# quadvals <- NULL
123-
# values <- NULL
124-
# basisvalues <- NULL
125-
# basisobj <- list(type=type, rangeval=rangeval, nbasis=nbasis,
126-
# params=params, dropind=dropind, quadvals=quadvals,
127-
# values=values, basisvalues=basisvalues, names=names)
128-
# oldClass(basisobj) <- "basisfd"
129-
# return(basisobj)
130-
# }
131-
132117
# ------------------------------------------------------------------------
133118
# Set up non-default basis
134119
# ------------------------------------------------------------------------
@@ -194,10 +179,6 @@ create.bspline.basis <- function (rangeval=NULL, nbasis=NULL,
194179
rangeval)
195180
rangeval = c(0,rangeval)
196181
}
197-
# if (!rangechk(rangeval)) stop("Argument 'rangeval' is not correct.")
198-
# if(!is.vector(rangeval))
199-
# stop('rangeval is not a vector; class(rangeval) = ',
200-
# class(rangeval))
201182
# rangeval too long ???
202183
if(length(rangeval)>2){
203184
if(!is.null(breaks))

R/create.fourier.basis.R

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,6 @@ create.fourier.basis <- function (rangeval=c(0,1), nbasis=3,
7878
# Default basis for missing arguments
7979

8080
type <- "fourier"
81-
#if (nargs()==0) {
82-
# rangeval <- c(0,1)
83-
# nbasis <- 3
84-
# params <- 1
85-
# dropind <- vector("numeric",0)
86-
# quadvals <- matrix("numeric",0,0)
87-
# values <- vector("list",0)
88-
# basisvalues <- vector("list",0)
89-
# basisobj <- list(type=type, rangeval=rangeval, nbasis=nbasis,
90-
# params=params, dropind=dropind, quadvals=quadvals,
91-
# values=values, basisvalues=basisvalues)
92-
# oldClass(basisobj) <- "basisfd"
93-
# return(basisobj)
94-
#}
9581
##
9682
## 1. check RANGEVAL
9783
##

R/create.monomial.basis.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ create.monomial.basis <- function(rangeval=c(0,1), nbasis=NULL,
44
axes=NULL)
55
{
66
# CREATE_MONOMIAL_BASIS Creates a monomial basis:, x^i_1, x^i_2, ...
7-
# The exponents in this version must be nonnegative integers
7+
# The exponents in this version must be non-negative integers
88
# Argument:
99
# RANGEVAL ...an array of length 2 containing the lower and upper
1010
# boundaries for the rangeval of argument values. If a
@@ -73,7 +73,7 @@ create.monomial.basis <- function(rangeval=c(0,1), nbasis=NULL,
7373
# Return:
7474
# BASISOBJ ...a functional data basis object of type "monom"
7575
#
76-
# last modified July 7, 2012 by Spencer Graves.
76+
# last modified July 25, 2022
7777
# for rangeval of class Date and POSIXct
7878
# Default basis for missing arguments
7979

@@ -84,9 +84,6 @@ create.monomial.basis <- function(rangeval=c(0,1), nbasis=NULL,
8484
op <- options(warn=-1)
8585
Rangeval <- as.numeric(rangeval)
8686
options(op)
87-
# if(!is.numeric(rangeval)){
88-
# stop('rangaval must be numeric; class(rangeval) = ',
89-
# class(rangeval) )
9087
if(length(rangeval)<1)
9188
stop('rangeval must be a numeric vector of length 2; ',
9289
'length(rangeval) = 0.')

R/fdPar.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# setClass for "fdPar"
2-
3-
# setClass("fdPar", representation(fd = "fd",
4-
# Lfd = "Lfd",
5-
# lambda = "numeric",
6-
# estimate = "logical",
7-
# penmat = "matrix",))
81

92
# Generator function of class fdPar
103

cran-comments.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

fdaReleaseToCRAN.R

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)