Adjust progragm for raspi
This commit is contained in:
parent
afdca597fe
commit
6a3be27cda
1
AutoConversion.cmd → AutoConversion.sh
Normal file → Executable file
1
AutoConversion.cmd → AutoConversion.sh
Normal file → Executable file
@ -1,2 +1 @@
|
|||||||
Rscript OpusData.R Rng02_Rng2630_01.0
|
Rscript OpusData.R Rng02_Rng2630_01.0
|
||||||
pause
|
|
12
OpusData.R
12
OpusData.R
@ -1,26 +1,18 @@
|
|||||||
#!/usr/bin/env Rscript
|
#!/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
|
# 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")
|
source("ReadOpus.R")
|
||||||
|
|
||||||
# Determine file path
|
# Determine file path
|
||||||
path <- paste(getwd(), "/OPUS/", sep = "")
|
path <- paste(getwd(), "/OPUS/", sep = "")
|
||||||
file_name <- "Rng02_Rng2630_01.0"
|
file_name <- commandArgs(trailingOnly = TRUE)[1]
|
||||||
file_path <- paste(path, file_name, sep = "")
|
file_path <- paste(path, file_name, sep = "")
|
||||||
|
|
||||||
# Convert opus binary file into dataframe
|
# Convert opus binary file into dataframe
|
||||||
data <- read_opus_univ(file_path)
|
data <- read_opus_univ(file_path)
|
||||||
|
|
||||||
# Set working directory to path where the result file should appear
|
# 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
|
# Replace last "." with "_", add ".DPT" and create file
|
||||||
file_name <- paste(sub(".([^.]*)$", "_\\1", file_name), ".DPT", sep = "")
|
file_name <- paste(sub(".([^.]*)$", "_\\1", file_name), ".DPT", sep = "")
|
||||||
|
Loading…
Reference in New Issue
Block a user