[R] R CMD check .
Robin Hankin
r.hankin at auckland.ac.nz
Thu Feb 13 00:34:03 CET 2003
Hello everybody
thanks for your help with my R CMD check problem. The file
Davies-Ex.Rout does indeed contain a transcript of the examples.
I've found the .Rd file that contains the problem. The relevant
command executes perfectly when I cut-and-paste it onto the R command
line, but not when executed by R CMD check. How can this be?
[tail of Davies-Ex.Rout included below]
The first four lines work fine (including a function listing) but the
final line "least.squares(rdavies(100,params))" fails, apparently
because the is.sorted argument doesn't take its default value of
FALSE. Anyone got any ideas as to why not?
robin
r:Davies.Rcheck% tail -27 Davies-Ex.Rout
> ##___ Examples ___:
>
> params <- c(10,0.1,-0.1)
> rdavies(n=5,params)
[1] 10.367054 9.068977 9.409128 8.326713 9.885775
> ddavies(10,params)
[1] 0.25
> least.squares
function (data, print = FALSE, is.sorted = FALSE, start.v = NULL)
{
if (is.sorted == FALSE) {
data <- sort(data)
}
if (is.null(start.v)) {
start.v <- start.davies(data)
}
jj <- optim(start.v, objective, dataset = data, is.sorted = TRUE)
if (print != TRUE) {
return(jj$par)
}
else {
return(list(parameters = jj$par, error = jj$value))
}
}
> least.squares(rdavies(100,params))
Error in if (is.sorted == FALSE) { : missing value where logical needed
Execution halted
r:Davies.Rcheck%
--
Robin Hankin, Lecturer,
School of Geography and Environmental Science
Tamaki Campus
Private Bag 92019 Auckland
New Zealand
r.hankin at auckland.ac.nz
tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042
More information about the R-help
mailing list