MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #13418] Variogram.gls #3512

Closed MichaelChirico closed 4 years ago

MichaelChirico commented 4 years ago

From: Andrzej Galecki <agalecki@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> Hello,

  1. Illustrating example: sessionInfo at the end of this email

library(nlme) fm1 <- gls(weight∼ Time * Diet, BodyWeight) Variogram(fm1, form =∼ Time | Rat)[1:10,]

Error in FUN(X[[1L]], ...) : unused argument(s) (method = "euclidean")

  1. It appears that the error is caused by the statement:

distance <- lapply(covar, function(el, metric) dist(as.matrix(el), metric), method = metric)

in Variogram.gls() method

  1. After replacing the statement in question with:

distance <- lapply(covar, function(el) dist(as.matrix(el), metric))

Variogram.gls appears to work properly as shown below.

library(nlme) fm1 <- gls(weight∼ Time * Diet, BodyWeight) Variogram(fm1, form =∼ Time | Rat)[1:10,]

    variog dist n.pairs

1 0.007239522 1 16 2 0.014584634 6 16 3 0.014207936 7 144 4 0.018442267 8 16 5 0.011128505 13 16 6 0.019910082 14 128 7 0.027072311 15 16 8 0.034140379 20 16 9 0.028320657 21 112 10 0.037525507 22 16

Happy Holiday Season and Happy New Year

Andrzej Galecki University of Michigan

sessionInfo()

R version 2.7.2 (2008-08-25) i386-pc-mingw32

locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] nlme_3.1-89

loaded via a namespace (and not attached): [1] grid_2.7.2 lattice_0.17-13 tools_2.7.2


METADATA

MichaelChirico commented 4 years ago

NOTES: Fixed in 3.1-90


METADATA

MichaelChirico commented 4 years ago

From: Prof Brian Ripley <ripley@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> It seems this was intended to be

             distance <- lapply(covar,
                                function(el, metric) dist(as.matrix(el), method=metric),
                                metric = metric)

similarly to Variogram.lme.

Thank you for the report: it will be fixed in the next release of nlme.

On Wed, 24 Dec 2008, agalecki@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> wrote:

Hello,

1. Illustrating example:
sessionInfo at the end of this email

library(nlme)
fm1 <- gls(weight ~ Time * Diet, BodyWeight)
Variogram(fm1, form = ~ Time | Rat)[1:10,]

Error in FUN(X[[1L]], ...) : unused argument(s) (method = "euclidean")

2. It appears that the error is caused by the statement:

distance <- lapply(covar, function(el, metric) dist(as.matrix(el),
metric), method = metric)

in Variogram.gls() method

3. After replacing the statement in question with:

distance <- lapply(covar, function(el) dist(as.matrix(el), metric))

Variogram.gls  appears to work properly as shown below.

library(nlme)
fm1 <- gls(weight ~ Time * Diet, BodyWeight)
Variogram(fm1, form = ~ Time | Rat)[1:10,]

variog dist n.pairs
1  0.007239522    1      16
2  0.014584634    6      16
3  0.014207936    7     144
4  0.018442267    8      16
5  0.011128505   13      16
6  0.019910082   14     128
7  0.027072311   15      16
8  0.034140379   20      16
9  0.028320657   21     112
10 0.037525507   22      16

Happy Holiday Season and Happy New Year

Andrzej Galecki
University of Michigan

> sessionInfo()
R version 2.7.2 (2008-08-25)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] nlme_3.1-89

loaded via a namespace (and not attached):
[1] grid_2.7.2      lattice_0.17-13 tools_2.7.2

______________________________________________
R-devel@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

-- Brian D. Ripley, ripley@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ <CENSORING FROM DETECTED PHONE NUMBER ONWARDS; SEE BUGZILLA>


METADATA

MichaelChirico commented 4 years ago

Audit (from Jitterbug): Sat Dec 27 07:41:11 2008 ripley changed notes Sat Dec 27 06:41:11 2008 ripley moved from incoming to Add-ons-fixed


METADATA