Skip to content

Global digits option causes error when displaying model results #4

@drewbo

Description

@drewbo

If we set

> options(digits=2)

early in the code for output reasons, we will later see an error when attempting to display our first model:

> glm.tune.1 <- train(Fate ~ Sex + Class + Age + Family + Embarked,
                data = train.batch,
                method = "glm",
                metric = "ROC",
                trControl = cv.ctrl)
> glm.tune.1
Generalized Linear Model 

714 samples
 11 predictor
  2 classes: 'Perished', 'Survived' 

No pre-processing
Resampling: Cross-Validated (10 fold, repeated 3 times) 

Summary of sample sizes: 643, 642, 643, 642, 642, 643, ... 

Resampling results

Error in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L,  : 
  invalid 'digits' argument

You can remedy this by setting

options(digits=4) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions