Skip to content

Quanteda overrides base summary behavior  #1285

Closed

Description

@ay60

Not sure if that is bug or a feature but that makes running summary against big data frames difficult.

Without quanteda loaded:

> summary(data.frame(a=c("aaa","bbb","ccc"),stringsAsFactors=FALSE))
      a            
 Length:3          
 Class :character  
 Mode  :character  

With quanteda loaded:

> summary(data.frame(a=c("aaa","bbb","ccc"),stringsAsFactors=FALSE))
    a      
 NULL:aaa  
 NULL:bbb  
 NULL:ccc  

Quanteda version is quanteda_1.1.1

With quanteda loaded running summary against a data frame with a character column and with many rows it takes a very long time to run and produces not very useful result.

Activity

  1. kbenoit commented on Mar 23, 2018

    @kbenoit
    Collaborator

    I investigated this and am fixing it now, but it turns out it's not quanteda, but rather network. We imported its entire namespace, however, so passed on the problem of it providing a summary.character() method. Will be fixed soon.

    From a clean session, without quanteda loaded:

    char <- c("aaa", "bbb", "ccc")
    df <- data.frame(char, stringsAsFactors = FALSE)
    
    summary(char)
    #    Length     Class      Mode 
    #         3 character character 
    summary(df)
    #      char          
    #  Length:3          
    #  Class :character  
    #  Mode  :character  
    
    library("network")
    # network: Classes for Relational Data
    # Version 1.13.0 created on 2015-08-31.
    # copyright (c) 2005, Carter T. Butts, University of California-Irvine
    #                     Mark S. Handcock, University of California -- Los Angeles
    #                     David R. Hunter, Penn State University
    #                     Martina Morris, University of Washington
    #                     Skye Bender-deMoll, University of Washington
    #  For citation information, type citation("network").
    #  Type help("network-package") to get started.
    
    summary(char)
    # aaa bbb ccc 
    #   1   1   1 
    summary(df)
    #    char    
    #  NULL:aaa  
    #  NULL:bbb  
    #  NULL:ccc 
  2. ay60 commented on Mar 23, 2018

    @ay60
    Author

    Thank you!
    Wonderful package by the way, thank you. I completely switched over from using tm to qaunteda now.

  3. kbenoit commented on Mar 24, 2018

    @kbenoit
    Collaborator

    @ay60 please re-install the latest master and try. Should be fixed now in b0bf173.

  4. ay60 commented on Mar 26, 2018

    @ay60
    Author

    It seems to have been fixed on the mainline. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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