Skip to content

Improve code in wl_convert_units.hyperSpec() #70

Open

Description

@GegznaV
  • switch sentence in the wl_convert_units.hyperSpec() may be replaced with with wl_create_label_from_units(to, on_failure = "pass as-is")
Details

Basing on the lines from R/wl_convert_units.R (see this comment ), this switch sentence:

  x@label$.wavelength <-
    switch(.wl_fix_unit_name(to),
       nm    = expression("Wavelength, nm"),
      invcm = expression(tilde(nu) / cm^-1),
      ev    = expression("Energy / eV"),
      freq  = expression(nu / THz),
      raman = expression(Raman ~ shift / cm^-1),
      to
    )

Could be replaced with:

x@label$.wavelength <- wl_create_label_from_units(to, on_failure = "pass as-is")

The issue is that the default labels would change too.

Related: #69

Activity

  1. bryanhanson commented on Feb 14, 2022

    @bryanhanson
    Contributor

    Spam

  2. deleted a comment from on Aug 6, 2022
  3. deleted a comment from on Aug 6, 2022
  4. added this to the After 1.0 release milestone on Aug 6, 2022
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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions