Skip to content

Commit 71de983

Browse files
committed
NaN fix (Bar, Box, Dotplot)
1 parent 051b537 commit 71de983

File tree

4 files changed

+52
-4
lines changed

4 files changed

+52
-4
lines changed

R/AS_barplot.R

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,22 @@ AS_barplot<-function(data,
5454
else if (asterisk =="Dunn"){
5555
p_val_data<-data[["Dunn"]]}
5656
else {
57-
print("Wrong asterisk input must be one of (Dunn,Scheffe,u_test,t_test)")}}
57+
print("Wrong asterisk input must be one of (Dunn,Scheffe,u_test,t_test)")}
58+
if(length(unique(data[["Data"]]$Group)) !=2){
59+
for(a in 1:nrow(p_val_data)){
60+
for(b in 1:ncol(p_val_data)){
61+
if(is.nan(p_val_data[a,b])==T){
62+
p_val_data[a,b]<-1
63+
}
64+
}
65+
}}
66+
else if (length(unique(data[["Data"]]$Group))==2){
67+
for(b in 1:length(p_val_data)){
68+
if(is.nan(p_val_data[b])==T){
69+
p_val_data[b]<-1
70+
}
71+
}
72+
}}
5873
###Plots###
5974
suppressWarnings(
6075
if (length(unique(data[["Data_renamed"]][["ZZZZ"]]))!=2){

R/AS_boxplot.R

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,23 @@ AS_boxplot<-function(data,
5454
else if (asterisk =="Dunn"){
5555
p_val_data<-data[["Dunn"]]}
5656
else {
57-
print("Wrong asterisk input must be one of (Dunn,Scheffe,u_test,t_test)")}}
57+
print("Wrong asterisk input must be one of (Dunn,Scheffe,u_test,t_test)")}
58+
if(length(unique(data[["Data"]]$Group)) !=2){
59+
for(a in 1:nrow(p_val_data)){
60+
for(b in 1:ncol(p_val_data)){
61+
if(is.nan(p_val_data[a,b])==T){
62+
p_val_data[a,b]<-1
63+
}
64+
}
65+
}}
66+
else if (length(unique(data[["Data"]]$Group))==2){
67+
for(b in 1:length(p_val_data)){
68+
if(is.nan(p_val_data[b])==T){
69+
p_val_data[b]<-1
70+
}
71+
}
72+
}
73+
}
5874
###Plots###
5975
suppressWarnings(
6076
if (length(unique(data[["Data_renamed"]][["Group"]]))!=2) {

R/AS_dotplot.R

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,23 @@ AS_dotplot<-function(data,
5454
else if (asterisk =="Dunn"){
5555
p_val_data<-data[["Dunn"]]}
5656
else {
57-
print("Wrong asterisk input must be one of (Dunn,Scheffe,u_test,t_test)")}}
57+
print("Wrong asterisk input must be one of (Dunn,Scheffe,u_test,t_test)")}
58+
if(length(unique(data[["Data"]]$Group)) !=2){
59+
for(a in 1:nrow(p_val_data)){
60+
for(b in 1:ncol(p_val_data)){
61+
if(is.nan(p_val_data[a,b])==T){
62+
p_val_data[a,b]<-1
63+
}
64+
}
65+
}}
66+
else if (length(unique(data[["Data"]]$Group))==2){
67+
for(b in 1:length(p_val_data)){
68+
if(is.nan(p_val_data[b])==T){
69+
p_val_data[b]<-1
70+
}
71+
}
72+
}
73+
}
5874
###Plots###
5975
suppressWarnings(
6076
if (length(unique(data[["Data_renamed"]][["Group"]]))!=2) {

man/NEWS.Rd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
\name{NEWS}
2-
\title{News for Package \pkg{LMSstat}}
2+
\alias{NEWS}
3+
\title{News for Package
34

45
\section{Changes in version 1.0.1,(February 2021)}{
56
\itemize{

0 commit comments

Comments
 (0)