tidymodels / broom

Convert statistical analysis objects from R into tidy format
https://broom.tidymodels.org
Other
1.45k stars 304 forks source link

Tidy Multivariate Models such as PLS and PCR #148

Closed therimalaya closed 3 years ago

therimalaya commented 8 years ago

I have to work regularly with PLS and PCR and other Multivariate models. I usually have to calculate RMSEP, MSEP, R2pred, loading weight, loadings, coefficients, number of component producing minimum error. Most often, I have to do cross-validation and extract similar statistic from each of the cross-validated models.

Please add mvr class in broom!

kyusque commented 5 years ago

@alexpghayes @therimalaya Hi, I also work with PLS and PCR on my research, and I would like to solve this issue. But, this is the first time for me to contribute an R package. Would you tell me how to contribute to this package? A work in progress repository is here. https://github.com/kyusque/broom

alexpghayes commented 5 years ago

Have you seen https://broom.tidyverse.org/articles/adding-tidiers.html? That's a good place to start!

kyusque commented 5 years ago

Thank you for the advice and I tried to conform to the document.

devtools::spell_check() and goodpractice::gp() were passed. But devtools::check() returned the following warnings.

❯ checking Rd cross-references ... WARNING
  Packages unavailable to check Rd xrefs: ‘drc’, ‘lfe’, ‘robust’, ‘joineRML’, ‘plm’, ‘poLCA’, ‘speedglm’, ‘gam’, ‘biglm’, ‘binGroup’, ‘ergm’, ‘tseries’, ‘geepack’, ‘gmm’, ‘lavaan’, ‘lmodel2’, ‘muhaz’, ‘orcutt’, ‘survey’, ‘akima’, ‘Kendall’, ‘btergm’, ‘multcomp’, ‘emmeans’, ‘lsmeans’, ‘epiR’, ‘gamlss’, ‘psych’, ‘ks’, ‘mediation’, ‘bbmle’, ‘leaps’, ‘AUC’, ‘systemfit’
  Missing link or links in documentation object 'augment.mvr.Rd':
    ‘[pls:cpplsr]{pls::cpplsr()}’
    ‘[pls:::predict.mvr]{pls::::predict.mvr()}’

  Missing link or links in documentation object 'glance.mvr.Rd':
    ‘[pls:cpplsr]{pls::cpplsr()}’

  Missing link or links in documentation object 'tidy.mvr.Rd':
    ‘[pls:cpplsr]{pls::cpplsr()}’ ‘i’

  See section 'Cross-references' in the 'Writing R Extensions' manual.

And, accidentally broom added in Import section in DESCRIPTION file. https://github.com/kyusque/broom/commit/8c416f06933f143e39a6cdb3c43533f9f27a35e6

I couldn't understand why it happened even I have read the section 'Cross-references' in the 'Writing R Extensions' manual.

Would you give me some advice to solve them? And, should I send a pull request to have a discussion on code (Is this expression correct?)?

uribo commented 5 years ago

Hi, @kyusque

pls::cpplsr is exported but used as an alias for mvr. You can try, [pls::cpplsr()][pls::mvr()] and other places.

https://github.com/bhmevik/pls/blob/master/man/mvr.Rd#L2-L6

kyusque commented 5 years ago

@uribo Thank you for the advice. I have finally solved that problem:smile: I will send a pull-request.

gtalckmin commented 4 years ago

Hi, how can I have access to this functionality? At the moment broom cannot run nor tidy or broom functions on mvr objects.

tidy_CP1<- tidy(CP1) Error: No tidy method for objects of class mvr tidy_CP1<- glance(CP1) Error: No glance method for objects of class mvr

github-actions[bot] commented 3 years ago

This issue has been automatically closed due to inactivity.

github-actions[bot] commented 3 years ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.