From 6a3be27cda81adba0a15edcec7b74b1497a39278 Mon Sep 17 00:00:00 2001 From: "Ruben Hartenstein (PEA4-Fe)" Date: Thu, 28 Jan 2021 07:29:01 +0000 Subject: [PATCH] Adjust progragm for raspi --- AutoConversion.cmd => AutoConversion.sh | 1 - OpusData.R | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) rename AutoConversion.cmd => AutoConversion.sh (86%) mode change 100644 => 100755 diff --git a/AutoConversion.cmd b/AutoConversion.sh old mode 100644 new mode 100755 similarity index 86% rename from AutoConversion.cmd rename to AutoConversion.sh index 69c3704..8d90a53 --- a/AutoConversion.cmd +++ b/AutoConversion.sh @@ -1,2 +1 @@ Rscript OpusData.R Rng02_Rng2630_01.0 -pause diff --git a/OpusData.R b/OpusData.R index ef1a53f..18fa659 100644 --- a/OpusData.R +++ b/OpusData.R @@ -1,26 +1,18 @@ #!/usr/bin/env Rscript -# Package installation, execute once -#install.packages("remotes") -#remotes::install_github("philipp-baumann/simplerspec") - # Attach package to workspace, execute with every new session -#library("simplerspec") -rm(list = ls()) -setwd("C:/Users/harte/Dokumente/git/opus-data-r") - source("ReadOpus.R") # Determine file path path <- paste(getwd(), "/OPUS/", sep = "") -file_name <- "Rng02_Rng2630_01.0" +file_name <- commandArgs(trailingOnly = TRUE)[1] file_path <- paste(path, file_name, sep = "") # Convert opus binary file into dataframe data <- read_opus_univ(file_path) # Set working directory to path where the result file should appear -setwd(paste(path, "..\\DPT", sep = "")) +setwd(paste(path, "../DPT", sep = "")) # Replace last "." with "_", add ".DPT" and create file file_name <- paste(sub(".([^.]*)$", "_\\1", file_name), ".DPT", sep = "")