Skip to content

In spc.bin(), na.rm = 2 throws error  #241

Closed

Description

@GegznaV

Is an error expected in this situation (spc.bin(na.rm = 2))?

suppressPackageStartupMessages(library(hyperSpec))

# Example 1: Error
data(flu, package = "hyperSpec")
flu[[3, , 3, wl.index = TRUE]] <- NA_real_
spc.bin(flu, 1, na.rm = 2)
#> Error in tapply(spc@wavelength, bin, mean, na.rm = na.rm > 0): arguments must have same length

Created on 2020-08-03 by the reprex package (v0.3.0)

More examples
suppressPackageStartupMessages(library(hyperSpec))

# Example 2: Error
data(flu, package = "hyperSpec")
flu[[, , 3, wl.index = TRUE]] <- NA_real_
spc.bin(flu, 1, na.rm = 2)
#> Error in tapply(spc@wavelength, bin, mean, na.rm = na.rm > 0): arguments must have same length

# Example 3: Error
data(flu, package = "hyperSpec")
flu[[3, ]] <- NA_real_
spc.bin(flu, 1, na.rm = 2)
#> Error in tapply(spc@wavelength, bin, mean, na.rm = na.rm > 0): arguments must have same length

Activity

  1. added
    Type: possibly bug ❓
    on Aug 3, 2020
  2. self-assigned this
    on Aug 24, 2020
  3. added
    Type: bug 💣
    and removed
    Type: possibly bug ❓
    on Aug 28, 2020
  4. GegznaV commented on Aug 12, 2021

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

Metadata

Metadata

Assignees

Labels

Type: bug 💣

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions