knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(RAWdataR)
library(knitr)

Inspect Directory

We can find out about projects and users for a particular directory by inspecting it.

path.RAW = raw.getSamplePath()
raw.inspectFolder(path.RAW)

One of the instruments is off, let us inspect which file that is:

basename(raw.findFiles(path.RAW, instrument='MM160622SI1'))

The data filename is missing an instrument. It appears to be a vsm data file. The instrument can be added as follows:

f = basename(raw.findFiles(path.RAW, instrument='MM160622SI1'))
f.new = basename(raw.fixInvalidFile(f, addInstrument='vsm'))
print(paste("Change:",f,"to:",f.new))

Find duplicate RAW data files

path.RAW = raw.getSamplePath()
f = raw.findDuplicates(path.RAW,isValid=FALSE)
d1 = data.frame(f=basename(f),md5=raw.getMD5(f),row.names = c())
kable(d1, col.names = c('Duplicated Files','MD5'))

This is the list of duplicated files. We can find out what the original file:

searchMD5 = d1$md5[!duplicated(d1$md5)]
for(m in searchMD5) {
  print(paste("Duplicates for files with MD5 = ",m))
  f = raw.findFiles(path.RAW, md5=m)
  print(basename(f))
}


thomasgredig/RAWdataR documentation built on Nov. 6, 2024, 9:46 a.m.