Import Raman measurements from Renishaw (possibly compressed) .txt file.

  file = stop("file is required"),
  data = "xyspc",
  nlines = 0,
  nspc = NULL

  file = stop("filename is required"),
  txt.file = sub("[.]zip", ".txt", basename(file)),



file name or connection


type of file, one of "spc", "xyspc", "zspc", "depth", "ts", see details.


number of lines to read in each chunk, if 0 or less read whole file at once.

nlines must cover at least one complete spectrum,i.e. nlines must be at least the number of data points per spectrum. Reasonable values start at 1e6.


number of spectra in the file


name of the .txt file in the .zip archive. Defaults to zip file's name with extension .txt instead of .zip.


Arguments for read_txt_Renishaw


hyperSpec object.


The file may be of any file type that can be read by base::gzfile() (i.e. text, or zipped by gzip, bzip2, xz or lzma). .zip zipped files need to be read using read_zip_Renishaw().

Renishaw .wxd files are converted to .txt ASCII files by their batch converter. They come in a "long" format with columns (y x | time | z)? wavelength intensity. The first columns depend on the data type.

The corresponding possibilities for the data argument are:

"spc"wl intsingle spectrum
"zspc", "depth"z wl intdepth profile
"ts"t wl inttime series
"xyspc"y x wl int2d map

This function allows reading very large ASCII files, but it does not work on files with missing values (NAs are allowed).

If the file is so large that it should be read in chunks and nspc is not given, read_txt_Renishaw tries to guess it by using count_lines().


C. Beleites