modelr | Helper functions
kandi X-RAY | modelr Summary
kandi X-RAY | modelr Summary
The modelr package provides functions that help you create elegant pipelines when modelling. It is designed primarily to support teaching the basics of modelling within the tidyverse, particularly in R for Data Science. Please see for a more comprehensive framework for modelling within the tidyverse.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of modelr
modelr Key Features
modelr Examples and Code Snippets
Community Discussions
Trending Discussions on modelr
QUESTION
I have an issue that might be silly in some ways, but following this question:
Linear Regression and group by in R
I tried to install the broom package in order to "retrieve the coefficients and Rsquared/p.value".
I know that the previous question is 12 years old but this package is still listed in my RStudio for installation, but then I have this error message and I am lost on what to do to make it work properly:
library(broom) Error in value[3L]: Package 'broom' version 0.7.12 cannot be loaded: Error in unloadNamespace(package): namespace 'broom' is imported by 'modelr', 'tidyverse', 'rstatix' and therefore cannot be unloaded
So my question is straightforward: what does it mean? Did broom become a dependancy of the 3 packages cited? How to make it work?
Thank you very much for your help.
EDIT: screenshot of the output to know why some numbers appear in red.
...ANSWER
Answered 2022-Apr-17 at 08:28Given your comments, you should be able to purrr::map broom::tidy over your list column of models.
QUESTION
Here is the package in github.
As you can see in travis.yml, warnings are not treated as errors. When I do the check()
in console, there are no errors. Here is the result:
ANSWER
Answered 2021-Oct-21 at 18:40I would seem that your package depends, at least, on raster
and sf
; and your script does not install them:
QUESTION
I'm trying to write a distill::distill_article
blogpost which requires the use of LaTeX math environments e.g. theorem, lemma, proof etc.
I have tried to follow these instructions and also these instructions but am unable to render the theorem
environments whether using LaTeX
blocks or rmarkdown blocks.
I also note that a similar question was asked about specifically using distill::distill_article
in bookdown
. This fix did not work either. Note that my use-case is to use the bookdown theorem environments inside distill::distill_article
, not the other way around.
Here is a reprex for the issue:
...ANSWER
Answered 2022-Jan-03 at 05:49Add this after the YAML and then the method between :::
will work:
QUESTION
I am trying to install the tidyverse package and not being able to do it. 1-tried via Packages -> Install 2-tried from console-> install.packages("tidyverse")
Gives errors as below and therefore not loading the lirary
...ANSWER
Answered 2021-Sep-27 at 21:44You have a very old version of R. You should update to the current version if you want things to go smoothly.
If you can't do that, here's what you'll have to do:
- Install the version of Rtools suitable for R 3.5.x.
- Install the packages you want. Some of them won't work, because they will need later versions of R, but won't declare that. So when you find one that fails, try installing the previous version of that package. If that also fails, try an even earlier one. Etc. Your R version was current in 2018, so you may need to go that far back in time to find compatible packages.
- Once you finally have everything working, try to update your packages. Maybe some of them could be more recent versions, maybe not. Do them one at a time. Typically
tidyverse
needs about 90 of them, so this will take a while.
So I recommend that you update your R version.
QUESTION
As of 18 Nov 2021, I've downloaded all the tar.gz files that tidyverse imports/depends/suggests. I'm working on a RedHat OS and, unfortunately, I don't have an Internet connection to this machine. I have all those files in a folder. Then I use this command
...ANSWER
Answered 2021-Nov-23 at 21:39Need to run tools::write_PACKAGES
before executing install.packages
.
Even though the tar.gz files are in the same folder, the PACKAGES file must be populated to properly account for dependencies. Otherwise, the install.packages function doesn't know how the packages are related. Would be nice if that error message was more specific.
QUESTION
I am building a custom recipes
function and getting an error when I try to prep()
the recipe. I get the following error:
ANSWER
Answered 2021-Nov-07 at 21:41@importFrom recipes prep bake
had to be added to the .R file
QUESTION
I’m creating a Shiny app that uses the caret package to do some SVM free-text analysis.
The app runs fine without any error in my computer. I’m using R x64 4.0.4 and R studio 1.3.1093
I’m deploying app to an internal enterprise server https://rconnect.xxxx.com/connect/#/apps/####
This app is deployed in the server and started.
But when I reach the line where I run the train function:
ANSWER
Answered 2021-Aug-05 at 01:15Errors like this in Shiny apps are almost always a result of missing packages, which the logs confirm.
Turns out in this case I think the missing package is kernlab
, which I only found by reading the documentation given here: https://topepo.github.io/caret/train-models-by-tag.html#Support_Vector_Machines. It's a suggested package, not imported, so the command suggested in the comments by heds1 would sort this out.
QUESTION
I’m attempting to add a circle using geom_polygon()
to add a reference line to radial bar chart. (I know this is not the ideal way to present this data, but it’s not entirely up to me).
Following this issue, I can create a nice circle:
ANSWER
Answered 2021-Jul-26 at 20:35One option would be to make use of geom_hline
instead of geom_polygon
:
QUESTION
I have a simple recipe to train a model. My categorical variables are changing over time and sometimes I want a numerical to be treated as categorical (postal code) , so I define a list prior to recipe containing them. (just for the sake of the argument, the list is much longer)
recipe worked ok, and then trained my model (3 folds) but an error is raised.
...ANSWER
Answered 2021-Jul-05 at 15:56You definitely were passing the vector of variables correctly to the recipe -- no problem there!
You were running into other problems with your model fitting. An xgboost model requires all predictors to be numeric, so if you convert something like zip code to factors, you need to then use step_dummy()
. If you have something of high cardinality like zip codes, you probably will need to handle new levels or unknown levels as well.
QUESTION
The example below is a simple one which tries to assert the column y is always positive (y>0). How can I extract the errored data (row 3 with the negative value,into a dataframe maybe, or any convenient object) while allowing the workflow to continue with "cleaned" data?
...ANSWER
Answered 2021-Apr-12 at 09:23This is tricky, and the answer below doesn't solve this 100%. Now there are a number of different ways assertr lets you handle errors/stops, just see ?error_stop (which is the default).
You need to not only filter out rows that fail, but also collect them (all) for later inspection.
Below I wrote my own error handler. It fetches those rows that fail, filter them away, and stores them in the global environment under the varibale my.failed.rows
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install modelr
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page