r-hyperspec / hySpc.read.spc

Import SPC files into hyperSpec
http://r-hyperspec.github.io/hySpc.read.spc/
MIT License
2 stars 2 forks source link

Error in `read.spc()` with R 4.2.0 #18

Open GegznaV opened 2 years ago

GegznaV commented 2 years ago

The original issue was https://github.com/r-hyperspec/hyperSpec/issues/80 Some aspects still are not solved.

Essence:

#> Warning in file(con, "rb"): file("") only supports open = "w+" and open = "w+b":
#> using the former
#> Error in readBin(filename, "raw", file.info(filename)$size, 1): can only read from a binary connection
``` r library(hySpc.read.spc) #> Loading required package: hyperSpec #> Loading required package: lattice #> Loading required package: grid #> Loading required package: ggplot2 #> #> #> Package hyperSpec (version 0.200.0.9000) #> #> To get started, try: #> vignette("hyperSpec", package = "hyperSpec") #> package?hyperSpec #> browseVignettes(package = "hyperSpec") #> vignette(package = "hyperSpec") #> #> If you use this package, please cite it appropriately. #> The correct reference is given by: #> citation("hyperSpec") #> #> The project's website: #> https://r-hyperspec.github.io/hyperSpec #> #> IMPORTANT! #> Existing users of 'hyperSpec' will find that many functions either have been renamed in favor of more consistent names or moved to other packages. To help you update your workflows, the list of the renamed and moved functions resides in the NEWS file of hyperSpec's documentation: #> #> help(package = "hyperSpec") #> #> Attaching package: 'hySpc.read.spc' #> The following objects are masked from 'package:hyperSpec': #> #> read.spc, read.spc.Kaiser, read.spc.KaiserLowHigh, #> read.spc.KaiserMap x <- hySpc.read.spc::read.spc( filename = system.file("extdata/1.spc", package = "ir"), log.txt = TRUE, log.bin = TRUE, log.disk = TRUE, keys.hdr2data = TRUE, keys.log2data = TRUE, no.object = FALSE ) #> Warning in file(con, "rb"): file("") only supports open = "w+" and open = "w+b": #> using the former #> Error in readBin(filename, "raw", file.info(filename)$size, 1): can only read from a binary connection ``` Created on 2022-07-14 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1)

@cbeleites, do you know how to solve this?

GegznaV commented 2 years ago

The error is due to empty input as ir package was not installed on my PC. The filename must not be empty and give a meaningful error message in case of wrong input.