If you are making a feature request or starting a discussion, you can ignore everything below and go wild =D However, please request new models using the project page.
If you are filing a bug, make sure these boxes are checked before submitting your issue— thank you!
[ ] Start a new R session
[ ] Install the latest version of caret: update.packages(oldPkgs="caret", ask=FALSE)
library(caret)
set.seed(1)
dat <- twoClassSim(100)
X <- dat[,1:5]
y <- dat[["Class"]]
If you have some data that would be too difficult to construct using caret::twoClassSim or caret::SLC14_1, then you can always make a subset of your original data, using e.g. head(), subset() or the indices. Then use e.g. dput() to give us something that can be put in R immediately, e.g. dput(head(iris,4))
If you must use dput(head()), please first remove an columns from your dataset that are not necessary to reproduce the error.
If your data frame has a factor with many levels, the dput output can be unwieldy because it will still list all the possible factor levels even if they aren't present in the the subset of your data. To solve this issue, you can use the droplevels() function. Notice below how species is a factor with only one level: dput(droplevels(head(iris, 4)))
You can delete the text in each section that explains how to do it correctly.
Be sure to test your 2 chunks of code in an empty R session before submitting your issue!
If you are making a feature request or starting a discussion, you can ignore everything below and go wild =D However, please request new models using the project page.
If you are filing a bug, make sure these boxes are checked before submitting your issue— thank you!
update.packages(oldPkgs="caret", ask=FALSE)
sessionInfo()
Minimal, reproducible example:
Please read this page: reprex = {repr}oducible {ex}ample; your issue can be easily formatted using the
reprex
package.Text and example code modified from the R FAQ on stackoverflow
Minimal dataset:
If you have some data that would be too difficult to construct using
caret::twoClassSim
orcaret::SLC14_1
, then you can always make a subset of your original data, using e.g.head()
,subset()
or the indices. Then use e.g.dput()
to give us something that can be put in R immediately, e.g.dput(head(iris,4))
If you must use
dput(head())
, please first remove an columns from your dataset that are not necessary to reproduce the error.If your data frame has a factor with many levels, the
dput
output can be unwieldy because it will still list all the possible factor levels even if they aren't present in the the subset of your data. To solve this issue, you can use thedroplevels()
function. Notice below how species is a factor with only one level:dput(droplevels(head(iris, 4)))
Minimal, runnable code:
Session Info:
You can delete the text in each section that explains how to do it correctly. Be sure to test your 2 chunks of code in an empty R session before submitting your issue!