Skip to content

Use mvrsquared instead of home-grown code#86

Open
Matt-Int wants to merge 14 commits intoTommyJones:mainfrom
Matt-Int:use_mvrsquared
Open

Use mvrsquared instead of home-grown code#86
Matt-Int wants to merge 14 commits intoTommyJones:mainfrom
Matt-Int:use_mvrsquared

Conversation

@Matt-Int
Copy link
Copy Markdown
Contributor

@Matt-Int Matt-Int commented Jun 28, 2021

This should switch out the homegrown r-squared code from textmineR package with the mvrsquared
calc_rsquared function. As per #84.

Tested and got the exact same r-squared from the old version and the new one. I've kept all of the original input
testing intact.

What followed was just some troubleshooting to get everything building and testing on my machine; but it all builds and passes now!

Matt-Int added 11 commits June 28, 2021 22:57
As per issue TommyJones#84, this should switch out the homegrown r-squared code from textmineR package with the mvrsquared
`calc_rsquared` function.

Tested and got the exact same r-squared from the old version and the new one. I've kept all of the original input
testing intact.
Also added some new lines to keep to 80 characters.
Was getting an error when running checks on Linux, adding this made the error no longer appear; may be because I didn't
have Pandoc installed, but not sure.
Currently a bit slow, I suspect this is because of %*% and that mvrsquared potentially handles this in a c++ export, but I think
this is fine as long as this isn't used directly in the CalcTopicModelR2 function.
Added the `...` as an argument to match the generic. The .Rd file is also automatically updated with this change, as is
the NAMESPACE.
As they're no longer used in the package keeping them in here introduces some build errors.
This is what I get for programming past midnight...
@Matt-Int
Copy link
Copy Markdown
Contributor Author

Matt-Int commented Jun 29, 2021

I just realised that I need to pass the ... of CalcTopicModelR2 into the calc_rsquared function or changing the threads argument won't change anything.

I'll do that tomorrow afternoon Europe time and test that things are still working.

Matt-Int added 3 commits June 29, 2021 21:21
Removed some of the new lines which were making it a bit less readable.

Also added the `...` arguments to the `calc_rsquared` function call.

Unfortunately this means that previous calls to this function that used `cpus` will now be broken.
Changing the `threads` back to `cpus` as the vignettes failed to build and there were some additional unexpected
behaviour from changing that argument name
Updated the parameter list and description following the previous commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant