Skip to content

Error with tibble #16

@alaindanet

Description

@alaindanet

The analysis runs without error but the scatter plot fails with a message which is difficult to relate to tibble because tibble inherits from data.frame class.

library('ade4')
library('tibble')

data(banque)
dataframe_acm <- dudi.acm(banque, scann = FALSE, nf = 3)
tibble_acm <- dudi.acm(as_tibble(banque), scann = FALSE, nf = 3)

scatter(dataframe_acm)

scatter(tibble_acm)
#> Error in s.class(x$li, oritab[, i], xax = xax, yax = yax, clabel = 1.5, : factor expected for fac

str(as_tibble(banque))
#> Classes 'tbl_df', 'tbl' and 'data.frame':    810 obs. of  21 variables:
#>  $ csp     : Factor w/ 9 levels "agric","artis",..: 6 3 3 8 7 8 8 8 6 1 ...
#>  $ duree   : Factor w/ 5 levels "dm2","d24","d48",..: 3 2 3 2 4 5 3 5 2 3 ...
#>  $ oppo    : Factor w/ 2 levels "non","oui": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ age     : Factor w/ 5 levels "ai25","ai35",..: 5 2 5 3 5 3 5 5 2 4 ...
#>  $ sexe    : Factor w/ 2 levels "hom","fem": 1 1 1 2 1 2 2 2 1 1 ...
#>  $ interdit: Factor w/ 2 levels "non","oui": 1 1 1 2 1 1 1 1 1 1 ...
#>  $ cableue : Factor w/ 2 levels "non","oui": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ assurvi : Factor w/ 2 levels "non","oui": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ soldevu : Factor w/ 6 levels "p4","p3","p2",..: 5 5 4 3 1 4 4 1 4 4 ...
#>  $ eparlog : Factor w/ 3 levels "for","fai","nul": 3 3 3 3 3 3 3 3 3 3 ...
#>  $ eparliv : Factor w/ 3 levels "for","fai","nul": 3 3 3 3 3 3 3 3 3 3 ...
#>  $ credhab : Factor w/ 2 levels "non","oui": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ credcon : Factor w/ 3 levels "nul","fai","for": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ versesp : Factor w/ 2 levels "oui","non": 2 2 2 1 2 2 2 2 2 2 ...
#>  $ retresp : Factor w/ 3 levels "fai","moy","for": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ remiche : Factor w/ 4 levels "for","moy","fai",..: 4 4 4 3 4 4 4 1 4 3 ...
#>  $ preltre : Factor w/ 3 levels "nul","fai","moy": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ prelfin : Factor w/ 3 levels "nul","fai","moy": 1 1 1 1 1 1 1 1 1 1 ...
#>  $ viredeb : Factor w/ 4 levels "nul","fai","moy",..: 1 1 1 1 2 1 1 1 1 1 ...
#>  $ virecre : Factor w/ 4 levels "for","moy","fai",..: 4 4 4 4 4 4 4 3 4 4 ...
#>  $ porttit : Factor w/ 4 levels "nul","fai","moy",..: 1 1 1 3 4 1 1 4 1 1 ...

Created on 2019-04-26 by the reprex package (v0.2.0.9000).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions