Skip to content

Commit

Permalink
Version 1.07
Browse files Browse the repository at this point in the history
Shapiro_test added
  • Loading branch information
CHKim5 committed Jul 22, 2021
1 parent 73d9d01 commit 6e2c48f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export(D_tran)
export(Indiv_Perm)
export(Multi_Perm)
export(NMDS)
export(Norm_test)
export(PCA)
export(aroc_compute)
export(data_summary)
Expand Down
18 changes: 18 additions & 0 deletions R/Norm_test.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#' Normality test with Shaprio_Wilk_test
#'
#' @param Data input data file
#'
#' @return dataframe with shapiro wilk test
#' @export
#'
#' @examples Result<-Norm_test(Data)
#' write.csv(Result,"Normality_test_Result.csv")
#'
Norm_test<-function(Data){
colnames(Data)<-Data[1,]; Data<-Data[-1,]
Data[,4:ncol(Data)]<-sapply(Data[,4:ncol(Data)],function(x) as.numeric(x))
Data<-as.data.frame(sapply(Data[,4:ncol(Data)], function(x)shapiro.test(x)[["p.value"]]))
colnames(Data)<-"Shapiro_Wilk_p_val"
Data<-Data %>% mutate(Normality = case_when(Shapiro_Wilk_p_val<=0.05~"Non_parametric",
Shapiro_Wilk_p_val>0.05~"Parametric"))
Data}
22 changes: 22 additions & 0 deletions man/Norm_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e2c48f

Please sign in to comment.