RcppCore / RcppEigen

Rcpp integration for the Eigen templated linear algebra library
Other
110 stars 40 forks source link

Warning messages: 1: partial match of 'df' to 'df.residual' #115

Closed sorin-pascu closed 1 year ago

sorin-pascu commented 1 year ago

Summary of models computed with fastLm() give the warning: Warning messages: 1: partial match of 'df' to 'df.residual' here the example from help:

?fastLm flmmod <- fastLm( log(Volume) ~ log(Girth), data=trees) summary(flmmod)

eddelbuettel commented 1 year ago

I do not see that under R 4.2.2:

> library(RcppEigen)
> flmmod <- fastLm( log(Volume) ~ log(Girth), data=trees)
> summary(flmmod)

Call:
fastLm.formula(formula = log(Volume) ~ log(Girth), data = trees)

Residuals:
    Min.  1st Qu.   Median  3rd Qu.     Max. 
-0.20600 -0.06870  0.00101  0.07260  0.24800 

            Estimate Std. Error t value Pr(>|t|)    
(Intercept) -2.35332    0.23066  -10.20 4.18e-11 ***
log(Girth)   2.19997    0.08983   24.49  < 2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.115 on 29 degrees of freedom
Multiple R-squared: 0.954,      Adjusted R-squared: 0.952
> 
sorin-pascu commented 1 year ago

I just upgraded – the error is there:

R version 4.2.2 (2022-10-31) -- "Innocent and Trusting"

Copyright (C) 2022 The R Foundation for Statistical Computing

Platform: x86_64-apple-darwin17.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.

You are welcome to redistribute it under certain conditions.

Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.

Type 'contributors()' for more information and

'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or

'help.start()' for an HTML browser interface to help.

Type 'q()' to quit R.

library(RcppEigen)

flmmod <- fastLm( log(Volume) ~ log(Girth), data=trees)

summary(flmmod)

Call:

fastLm.formula(formula = log(Volume) ~ log(Girth), data = trees)

Residuals:

     Min.   1st Qu.    Median   3rd Qu.      Max.

-0.206000 -0.068700  0.001011  0.072580  0.248000

             Estimate Std. Error t value  Pr(>|t|)   

(Intercept) -2.353325   0.230663 -10.202  4.18e-11 ***

log(Girth)   2.199970   0.089835  24.489 < 2.2e-16 ***


Signif. codes:  0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.115 on 29 degrees of freedom

Multiple R-squared: 0.9539,        Adjusted R-squared: 0.9523

Warning messages:

1: In object$df : partial match of 'df' to 'df.residual'

2: In object$df : partial match of 'df' to 'df.residual'

3: In x$df : partial match of 'df' to 'df.residual'

Kind regards,

Sorin

Sorin Pascu

M: +49 151 412 408 58

Pflichtangaben nach § 37a HGB befinden sich unter folgendem Link:

https://www.appstam.com/impressum

From: Dirk Eddelbuettel @.> Reply to: RcppCore/RcppEigen @.> Date: Friday, 4. November 2022 at 16:12 To: RcppCore/RcppEigen @.> Cc: Appstam Eigene @.>, Author @.***> Subject: Re: [RcppCore/RcppEigen] Warning messages: 1: partial match of 'df' to 'df.residual' (Issue #115)

I do not see that under R 4.2.2:

library(RcppEigen)

flmmod <- fastLm( log(Volume) ~ log(Girth), data=trees)

summary(flmmod)

Call:

fastLm.formula(formula = log(Volume) ~ log(Girth), data = trees)

Residuals:

    Min.  1st Qu.   Median  3rd Qu.     Max.

-0.20600 -0.06870  0.00101  0.07260  0.24800

            Estimate Std. Error t value Pr(>|t|)   

(Intercept) -2.35332    0.23066  -10.20 4.18e-11 ***

log(Girth)   2.19997    0.08983   24.49  < 2e-16 ***


Signif. codes:  0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.115 on 29 degrees of freedom

Multiple R-squared: 0.954,      Adjusted R-squared: 0.952

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

eddelbuettel commented 1 year ago

You must have something enabled in your R profile that I, or CRAN, do not have. Try R --vanilla or alike.

For reference the package is fine at CRAN (ignore the warning about init.c, I have been fixing this in a few other packages too).

eddelbuettel commented 1 year ago

(That said, we do return df.residual in the C++ code and do access df so I see where this is coming from (and should be able to fix this). But you also seem to have an extra strong warning on that is not the default.)

eddelbuettel commented 1 year ago

It is options(warnPartialMatchDollar). It is not TRUE by default so that seems to be your local issue. I'll take a look at fixing this though now that I know it is there.

eddelbuettel commented 1 year ago

This is now on CRAN as a fixed version 0.3.3.9.3.