Skip to content

2018 non-functionality #34

Description

@erex

Error arises when doing conversion of (allegedly) simple project (songbird, filtering for song sparrow, w=68)

Tracked error to function unit_tab()

Error in `$<-.data.frame`(`*tmp*`, Conversion, value = numeric(0)) : 
  replacement has 0 rows, data has 74
In addition: Warning message:
Unknown or uninitialised column: 'Conversion'. 

The beast created by read.delim() trick is messy. Solution appears to be this:

Browse[2]> str(unit_tab)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame':	74 obs. of  2 variables:
 $                  Unit     : chr  "                     Degree  " "                        Gon  " "                       Grad  " "                Microradian  " ...
 $      Conversion           : chr  " 1.745329251994329547437e-02" " 1.570796326794896696777e-02" " 1.570796326794896696777e-02" " 9.999999999999999547481e-07" ...
 - attr(*, "spec")=List of 2
  ..$ cols   :List of 2
  .. ..$                  Unit     : list()
  .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
  .. ..$      Conversion           : list()
  .. .. ..- attr(*, "class")= chr  "collector_character" "collector"
  ..$ default: list()
  .. ..- attr(*, "class")= chr  "collector_guess" "collector"
  ..- attr(*, "class")= chr "col_spec"
Browse[2]> names(unit_tab)
[1] "                 Unit     " "     Conversion"           
Browse[2]> names(unit_tab) <- c("Unit", "Conversion")
Browse[2]> n
debug: return(unit_tab)

I'll made that change and commit

Activity

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