Skip to content

Commit ebd7bd4

Browse files
committed
style: fixed whitespace, removed zombie code
1 parent 0e98b7c commit ebd7bd4

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

R/aston_parsers.R

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#' Converter for Agilent MassHunter UV files
22
#'
3-
#' Converts a single chromatogram from MassHunter \code{.sp} format to R \code{data.frame}.
3+
#' Converts a single chromatogram from MassHunter \code{.sp} format to R
4+
#' \code{data.frame}.
45
#'
56
#' Uses the [Aston](https://github.com/bovee/aston) file parser.
67
#'
@@ -40,7 +41,8 @@ sp_converter <- function(file, format_out = c("matrix", "data.frame"),
4041

4142
#' Converter for Agilent ChemStation UV files
4243
#'
43-
#' Converts a single chromatogram from ChemStation \code{.uv} format to R \code{data.frame}.
44+
#' Converts a single chromatogram from ChemStation \code{.uv} format to R
45+
#' \code{data.frame}.
4446
#'
4547
#' Uses the [Aston](https://github.com/bovee/aston) file parser.
4648
#'
@@ -74,10 +76,9 @@ uv_converter <- function(file, format_out = c("matrix","data.frame"),
7476
}
7577
if (correction){
7678
# multiply by empirical correction value
77-
x <- apply(x,2,function(xx)xx*0.9536743164062551070259132757200859487056732177734375)
79+
correction_value <- 0.9536743164062551070259132757200859487056732177734375
80+
x <- apply(x,2,function(xx)xx*correction_value)
7881
}
79-
# correct column order
80-
# x <- lapply(x, function(xx) xx[,order(as.numeric(colnames(xx)))])
8182
if (read_metadata){
8283
meta <- read_chemstation_metadata(file)
8384
x <- attach_metadata(x, meta, format_in = "chemstation_uv",
@@ -129,24 +130,21 @@ trace_converter <- function(file, format_out = c("matrix", "data.frame"),
129130
#' @author Ethan Bass
130131
#' @import reticulate
131132
#' @export
132-
configure_aston <- function(return_boolean=FALSE){
133+
configure_aston <- function(return_boolean = FALSE){
133134
install <- FALSE
134-
# path <- miniconda_path()
135135
if (!dir.exists(miniconda_path())){
136136
install <- readline("It is recommended to install miniconda in your R library to use Aston parsers. Install miniconda now? (y/n)")
137137
if (install %in% c('y', "Y", "YES", "yes", "Yes")){
138138
install_miniconda()
139139
}
140-
} # else{
141-
# envs <- conda_list()
142-
# use_miniconda(envs[grep("r-reticulate", envs$name)[1],2])
143-
# }
140+
}
144141
env <- reticulate::configure_environment("chromConverter")
145142
if (!env){
146143
reqs <- c("pandas","scipy","numpy","aston")
147144
reqs_available <- sapply(reqs, reticulate::py_module_available)
148145
if (!all(reqs_available)){
149-
conda_install(envname = "chromConverter", reqs[which(!reqs_available)], pip = TRUE)
146+
conda_install(envname = "chromConverter", reqs[which(!reqs_available)],
147+
pip = TRUE)
150148
}
151149
}
152150
assign_trace_file()

R/read_cdf.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' @author Ethan Bass
1313
#' @export
1414

15-
read_cdf <- function(file, format_out = c("matrix","data.frame"),
15+
read_cdf <- function(file, format_out = c("matrix", "data.frame"),
1616
data_format = c("wide","long"),
1717
what = "chromatogram", read_metadata = TRUE){
1818
check_for_pkg("ncdf4")

0 commit comments

Comments
 (0)