Skip to content

Commit 9577ce2

Browse files
committed
added remove outlier fct
1 parent f904f61 commit 9577ce2

29 files changed

+33
-2
lines changed

.gitignore

100755100644
File mode changed.

BiostatsGithubPage/check_ast.R

100755100644
File mode changed.

Biostats_Standalone/check_ast.R

100755100644
File mode changed.

Biostats_Standalone/run.sh

100755100644
File mode changed.

Biostats_Standalone/server.R

100755100644
File mode changed.

Biostats_Standalone/ui.R

100755100644
File mode changed.

Dockerfile

100755100644
File mode changed.

MTT/DESCRIPTION

100755100644
File mode changed.

MTT/R/Screening Report.docx

100755100644
File mode changed.

MTT/R/create_excel.R

100755100644
File mode changed.

MTT/R/create_pdf.R

100755100644
File mode changed.

MTT/R/import.R

100755100644
+28-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
#'
33
#' @export
44
#' @param string is a xml file as string
5+
#' @param names is a data.frame which defines the names of the wells. This argument is optional. The default value can be checked using names_default()
6+
#' @param conc is a data.frame which defines the concentrations within the wells. This argument is optional. The default value can be checked using conc_default()
57
#' @return data.frame containg the imported data with the corresponding names and conc.
6-
XML2DF <- function(string) {
8+
XML2DF <- function(string, names, conc) {
79
pg <- xml2::as_xml_document(string)
810
test <- xml2::xml_child(pg, search = 4)
911
test <- xml2::as_list(test)
@@ -25,6 +27,11 @@ XML2DF <- function(string) {
2527
)
2628
row.names(df) <- NULL
2729
df <- df[, -1]
30+
names <- stack(names)
31+
conc <- stack(conc)
32+
df <- stack(df)
33+
df <- data.frame(abs = df$values, names = names$values, conc = conc$values)
34+
df <- df[!is.na(df[, 2]), ]
2835
df
2936
}
3037

@@ -123,3 +130,23 @@ import <- function(path, names = names_default(), conc = conc_default()) {
123130

124131

125132

133+
#' remove outliers
134+
#'
135+
#' @export
136+
#' @param df a data.frame from which the outliers should be removed
137+
#' @param l a list containing column indices which defines the different groups
138+
#' @param dep the column index which defines the dependent variable
139+
removeOutlier <- function(df, l, dep) {
140+
int <- sapply(seq_along(1:length(df)), function(x) {
141+
paste0(df[, l], collapse = "_")
142+
})
143+
intUnique <- unique(int)
144+
dfor <- lapply(intUnique, function(x) {
145+
temp <- df[int == x, ]
146+
bs <- boxplot.stats(temp$abs)
147+
if (length(bs$out) == 0) return(temp)
148+
temp[temp$abs %in% bs$out, "abs"] <- NA
149+
return(temp)
150+
})
151+
do.call(rbind, dfor)
152+
}

MTT/data/.~reening Report.docx

100755100644
File mode changed.

MTT/data/Screening Report.docx

100755100644
File mode changed.

MTT/data/test.xlsx

100755100644
File mode changed.

MTT/data/testing/data.rds

100755100644
File mode changed.

MTT/inst/examples/references.bib

100755100644
File mode changed.

MTT/man/XML2DF.Rd

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/check_ast.R

100755100644
File mode changed.

app/server.R

100755100644
File mode changed.

app/ui.R

100755100644
File mode changed.

build_and_run.sh

100755100644
File mode changed.

docu.pdf

100755100644
File mode changed.

docu.qmd

100755100644
File mode changed.

integrate_app_in_ror.docx

100755100644
File mode changed.

push2docker.sh

100755100644
File mode changed.

run.sh

100755100644
File mode changed.

test.csv

100755100644
File mode changed.

testfile.csv

100755100644
File mode changed.

0 commit comments

Comments
 (0)