diff --git a/SystBloodPressure_tidy.csv b/SystBloodPressure_tidy.csv new file mode 100644 index 0000000..061a24b --- /dev/null +++ b/SystBloodPressure_tidy.csv @@ -0,0 +1,766 @@ +Method,Replicate,BP +J,1,100 +J,1,108 +J,1,76 +J,1,108 +J,1,124 +J,1,122 +J,1,116 +J,1,114 +J,1,100 +J,1,108 +J,1,100 +J,1,108 +J,1,112 +J,1,104 +J,1,106 +J,1,122 +J,1,100 +J,1,118 +J,1,140 +J,1,150 +J,1,166 +J,1,148 +J,1,174 +J,1,174 +J,1,140 +J,1,128 +J,1,146 +J,1,146 +J,1,220 +J,1,208 +J,1,94 +J,1,114 +J,1,126 +J,1,124 +J,1,110 +J,1,90 +J,1,106 +J,1,218 +J,1,130 +J,1,136 +J,1,100 +J,1,100 +J,1,124 +J,1,164 +J,1,100 +J,1,136 +J,1,114 +J,1,148 +J,1,160 +J,1,84 +J,1,156 +J,1,110 +J,1,100 +J,1,100 +J,1,86 +J,1,106 +J,1,108 +J,1,168 +J,1,166 +J,1,146 +J,1,204 +J,1,96 +J,1,134 +J,1,138 +J,1,134 +J,1,156 +J,1,124 +J,1,114 +J,1,112 +J,1,112 +J,1,202 +J,1,132 +J,1,158 +J,1,88 +J,1,170 +J,1,182 +J,1,112 +J,1,120 +J,1,110 +J,1,112 +J,1,154 +J,1,116 +J,1,108 +J,1,106 +J,1,122 +J,2,106 +J,2,110 +J,2,84 +J,2,104 +J,2,112 +J,2,140 +J,2,108 +J,2,110 +J,2,108 +J,2,92 +J,2,106 +J,2,112 +J,2,112 +J,2,108 +J,2,108 +J,2,122 +J,2,102 +J,2,118 +J,2,134 +J,2,148 +J,2,154 +J,2,156 +J,2,172 +J,2,166 +J,2,144 +J,2,134 +J,2,138 +J,2,152 +J,2,218 +J,2,200 +J,2,84 +J,2,124 +J,2,120 +J,2,124 +J,2,120 +J,2,90 +J,2,106 +J,2,202 +J,2,128 +J,2,136 +J,2,96 +J,2,98 +J,2,116 +J,2,168 +J,2,102 +J,2,126 +J,2,108 +J,2,120 +J,2,150 +J,2,92 +J,2,162 +J,2,98 +J,2,106 +J,2,102 +J,2,74 +J,2,100 +J,2,110 +J,2,188 +J,2,150 +J,2,142 +J,2,198 +J,2,94 +J,2,126 +J,2,144 +J,2,136 +J,2,160 +J,2,138 +J,2,110 +J,2,116 +J,2,116 +J,2,220 +J,2,136 +J,2,162 +J,2,76 +J,2,174 +J,2,176 +J,2,114 +J,2,118 +J,2,108 +J,2,112 +J,2,134 +J,2,112 +J,2,110 +J,2,98 +J,2,112 +J,3,107 +J,3,108 +J,3,82 +J,3,104 +J,3,112 +J,3,124 +J,3,102 +J,3,112 +J,3,112 +J,3,100 +J,3,104 +J,3,122 +J,3,110 +J,3,104 +J,3,102 +J,3,114 +J,3,102 +J,3,120 +J,3,138 +J,3,144 +J,3,154 +J,3,134 +J,3,166 +J,3,150 +J,3,144 +J,3,130 +J,3,140 +J,3,148 +J,3,220 +J,3,192 +J,3,86 +J,3,116 +J,3,122 +J,3,132 +J,3,128 +J,3,94 +J,3,110 +J,3,208 +J,3,130 +J,3,130 +J,3,88 +J,3,88 +J,3,122 +J,3,154 +J,3,100 +J,3,122 +J,3,122 +J,3,132 +J,3,148 +J,3,98 +J,3,152 +J,3,98 +J,3,106 +J,3,94 +J,3,76 +J,3,110 +J,3,106 +J,3,178 +J,3,154 +J,3,132 +J,3,188 +J,3,86 +J,3,124 +J,3,140 +J,3,142 +J,3,154 +J,3,138 +J,3,114 +J,3,122 +J,3,134 +J,3,228 +J,3,134 +J,3,152 +J,3,88 +J,3,176 +J,3,180 +J,3,124 +J,3,120 +J,3,106 +J,3,106 +J,3,130 +J,3,94 +J,3,114 +J,3,100 +J,3,112 +R,1,98 +R,1,108 +R,1,76 +R,1,110 +R,1,128 +R,1,124 +R,1,118 +R,1,112 +R,1,100 +R,1,108 +R,1,102 +R,1,108 +R,1,114 +R,1,104 +R,1,104 +R,1,118 +R,1,102 +R,1,116 +R,1,138 +R,1,148 +R,1,164 +R,1,136 +R,1,170 +R,1,174 +R,1,140 +R,1,128 +R,1,146 +R,1,146 +R,1,220 +R,1,204 +R,1,94 +R,1,112 +R,1,124 +R,1,126 +R,1,110 +R,1,88 +R,1,106 +R,1,218 +R,1,128 +R,1,136 +R,1,100 +R,1,100 +R,1,126 +R,1,164 +R,1,100 +R,1,136 +R,1,114 +R,1,146 +R,1,160 +R,1,86 +R,1,156 +R,1,108 +R,1,100 +R,1,100 +R,1,88 +R,1,106 +R,1,106 +R,1,170 +R,1,164 +R,1,144 +R,1,206 +R,1,96 +R,1,132 +R,1,140 +R,1,136 +R,1,156 +R,1,122 +R,1,112 +R,1,112 +R,1,114 +R,1,200 +R,1,134 +R,1,158 +R,1,90 +R,1,172 +R,1,184 +R,1,112 +R,1,118 +R,1,110 +R,1,112 +R,1,156 +R,1,118 +R,1,106 +R,1,104 +R,1,122 +R,2,98 +R,2,112 +R,2,88 +R,2,100 +R,2,112 +R,2,140 +R,2,110 +R,2,108 +R,2,106 +R,2,98 +R,2,108 +R,2,116 +R,2,112 +R,2,108 +R,2,106 +R,2,122 +R,2,102 +R,2,118 +R,2,136 +R,2,146 +R,2,154 +R,2,154 +R,2,170 +R,2,166 +R,2,144 +R,2,134 +R,2,138 +R,2,152 +R,2,218 +R,2,200 +R,2,84 +R,2,126 +R,2,120 +R,2,126 +R,2,122 +R,2,88 +R,2,108 +R,2,200 +R,2,126 +R,2,138 +R,2,96 +R,2,98 +R,2,116 +R,2,168 +R,2,104 +R,2,124 +R,2,108 +R,2,130 +R,2,152 +R,2,92 +R,2,158 +R,2,100 +R,2,108 +R,2,102 +R,2,76 +R,2,100 +R,2,118 +R,2,188 +R,2,150 +R,2,142 +R,2,198 +R,2,94 +R,2,126 +R,2,142 +R,2,134 +R,2,162 +R,2,140 +R,2,114 +R,2,114 +R,2,114 +R,2,220 +R,2,136 +R,2,164 +R,2,76 +R,2,174 +R,2,174 +R,2,112 +R,2,116 +R,2,108 +R,2,110 +R,2,136 +R,2,114 +R,2,110 +R,2,100 +R,2,114 +R,3,111 +R,3,110 +R,3,82 +R,3,106 +R,3,114 +R,3,126 +R,3,102 +R,3,112 +R,3,112 +R,3,100 +R,3,106 +R,3,120 +R,3,110 +R,3,104 +R,3,102 +R,3,114 +R,3,100 +R,3,118 +R,3,134 +R,3,144 +R,3,148 +R,3,132 +R,3,164 +R,3,154 +R,3,144 +R,3,130 +R,3,138 +R,3,148 +R,3,220 +R,3,190 +R,3,88 +R,3,118 +R,3,120 +R,3,120 +R,3,126 +R,3,94 +R,3,110 +R,3,206 +R,3,128 +R,3,128 +R,3,86 +R,3,88 +R,3,122 +R,3,154 +R,3,102 +R,3,122 +R,3,122 +R,3,132 +R,3,146 +R,3,98 +R,3,152 +R,3,98 +R,3,108 +R,3,96 +R,3,76 +R,3,108 +R,3,106 +R,3,182 +R,3,154 +R,3,130 +R,3,188 +R,3,84 +R,3,124 +R,3,138 +R,3,140 +R,3,156 +R,3,136 +R,3,114 +R,3,124 +R,3,136 +R,3,226 +R,3,132 +R,3,150 +R,3,86 +R,3,178 +R,3,178 +R,3,126 +R,3,120 +R,3,106 +R,3,106 +R,3,132 +R,3,96 +R,3,114 +R,3,100 +R,3,114 +S,1,122 +S,1,121 +S,1,95 +S,1,127 +S,1,140 +S,1,139 +S,1,122 +S,1,130 +S,1,119 +S,1,126 +S,1,107 +S,1,123 +S,1,131 +S,1,123 +S,1,127 +S,1,142 +S,1,104 +S,1,117 +S,1,139 +S,1,143 +S,1,181 +S,1,149 +S,1,173 +S,1,160 +S,1,158 +S,1,139 +S,1,153 +S,1,138 +S,1,228 +S,1,190 +S,1,103 +S,1,131 +S,1,131 +S,1,126 +S,1,121 +S,1,97 +S,1,116 +S,1,215 +S,1,141 +S,1,153 +S,1,113 +S,1,109 +S,1,145 +S,1,192 +S,1,112 +S,1,152 +S,1,141 +S,1,206 +S,1,151 +S,1,112 +S,1,162 +S,1,117 +S,1,119 +S,1,136 +S,1,112 +S,1,120 +S,1,117 +S,1,194 +S,1,167 +S,1,173 +S,1,228 +S,1,77 +S,1,154 +S,1,154 +S,1,145 +S,1,200 +S,1,188 +S,1,149 +S,1,136 +S,1,128 +S,1,204 +S,1,184 +S,1,163 +S,1,93 +S,1,178 +S,1,202 +S,1,162 +S,1,227 +S,1,133 +S,1,202 +S,1,158 +S,1,124 +S,1,114 +S,1,137 +S,1,121 +S,2,128 +S,2,127 +S,2,94 +S,2,127 +S,2,131 +S,2,142 +S,2,112 +S,2,129 +S,2,122 +S,2,113 +S,2,113 +S,2,125 +S,2,129 +S,2,126 +S,2,119 +S,2,133 +S,2,116 +S,2,113 +S,2,127 +S,2,155 +S,2,170 +S,2,156 +S,2,170 +S,2,155 +S,2,152 +S,2,144 +S,2,150 +S,2,144 +S,2,228 +S,2,183 +S,2,99 +S,2,131 +S,2,123 +S,2,129 +S,2,114 +S,2,94 +S,2,121 +S,2,201 +S,2,133 +S,2,143 +S,2,107 +S,2,105 +S,2,102 +S,2,178 +S,2,116 +S,2,144 +S,2,141 +S,2,188 +S,2,147 +S,2,125 +S,2,165 +S,2,118 +S,2,131 +S,2,116 +S,2,115 +S,2,118 +S,2,118 +S,2,191 +S,2,160 +S,2,161 +S,2,218 +S,2,89 +S,2,156 +S,2,155 +S,2,154 +S,2,180 +S,2,147 +S,2,217 +S,2,132 +S,2,125 +S,2,222 +S,2,187 +S,2,160 +S,2,88 +S,2,181 +S,2,199 +S,2,166 +S,2,227 +S,2,127 +S,2,190 +S,2,121 +S,2,149 +S,2,118 +S,2,135 +S,2,123 +S,3,124 +S,3,128 +S,3,98 +S,3,135 +S,3,124 +S,3,136 +S,3,112 +S,3,135 +S,3,122 +S,3,111 +S,3,111 +S,3,125 +S,3,122 +S,3,114 +S,3,126 +S,3,137 +S,3,115 +S,3,112 +S,3,113 +S,3,133 +S,3,166 +S,3,140 +S,3,154 +S,3,170 +S,3,154 +S,3,141 +S,3,154 +S,3,131 +S,3,226 +S,3,184 +S,3,106 +S,3,124 +S,3,124 +S,3,125 +S,3,125 +S,3,96 +S,3,127 +S,3,207 +S,3,146 +S,3,138 +S,3,102 +S,3,97 +S,3,137 +S,3,171 +S,3,116 +S,3,147 +S,3,137 +S,3,166 +S,3,136 +S,3,124 +S,3,189 +S,3,109 +S,3,124 +S,3,113 +S,3,104 +S,3,132 +S,3,115 +S,3,196 +S,3,161 +S,3,154 +S,3,189 +S,3,101 +S,3,141 +S,3,148 +S,3,166 +S,3,179 +S,3,139 +S,3,192 +S,3,133 +S,3,142 +S,3,224 +S,3,192 +S,3,152 +S,3,88 +S,3,181 +S,3,195 +S,3,148 +S,3,219 +S,3,126 +S,3,213 +S,3,134 +S,3,137 +S,3,126 +S,3,134 +S,3,128 \ No newline at end of file diff --git a/app.R b/app.R index 90aab60..a8f555c 100644 --- a/app.R +++ b/app.R @@ -117,7 +117,7 @@ Okabe_Ito <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", #Read a text file (comma separated values) df_tidy_example <- read.csv("combined.csv", na.strings = "", stringsAsFactors = TRUE) -df_tidy_example2 <- read.csv("another_example.csv", na.strings = "", stringsAsFactors = TRUE) +df_tidy_example2 <- read.csv("SystBloodPressure_tidy.csv", na.strings = "", stringsAsFactors = TRUE) # Create a reactive object here that we can share between all the sessions. vals <- reactiveValues(count=0) @@ -138,7 +138,7 @@ ui <- fluidPage( list( # "Example data (tidy format)" = 1, "Example data (tidy)" = 1, - # "Example data (wide)" = 2, + "Example data (tidy)" = 2, "Upload file" = 3, "Paste data" = 4, "URL (csv files only)" = 5 @@ -153,6 +153,11 @@ ui <- fluidPage( condition = "input.data_input=='1'", p("Data S1 published in the original SuperPlots paper:"),a("https://doi.org/10.1083/jcb.202001064", href="https://doi.org/10.1083/jcb.202001064") ), + conditionalPanel( + condition = "input.data_input=='2'", + p("Data from Table 1 of:"),a("Bland & Altman (1999)", href="https://doi.org/10.1177/096228029900800204") + ), + conditionalPanel( condition = "input.data_input=='3'", h5("Upload file: "), @@ -475,8 +480,8 @@ df_upload <- reactive({ if (input$data_input == 2) { data <- df_tidy_example2 - x_var.selected <<- "Condition" - y_var.selected <<- "Activity" + x_var.selected <<- "Method" + y_var.selected <<- "BP" g_var.selected <<- "Replicate" } else if (input$data_input == 1) { data <- df_tidy_example @@ -968,6 +973,7 @@ df_selected <- reactive({ y_choice <- input$y_var g_choice <- input$g_var + #Prevent error if y parameter is not selected if (input$y_var =='none') { koos <- df_temp %>% select(Condition = !!x_choice) @@ -977,15 +983,26 @@ df_selected <- reactive({ } if (g_choice == "-") { - - koos <- df_temp %>% select(Condition = !!x_choice , Value = !!y_choice) %>% filter(!is.na(Value)) - koos$Replica <- as.factor("1") + if (input$x_var =='none') { + koos <- df_temp %>% select(Value = !!y_choice) %>% filter(!is.na(Value)) + koos$Replica <- as.factor("1") + koos$Condition <- as.factor("1") + } else { + koos <- df_temp %>% select(Condition = !!x_choice , Value = !!y_choice) %>% filter(!is.na(Value)) + koos$Replica <- as.factor("1") + } } else { - + #Prevent error if x parameter is not selected + if (input$x_var =='none') { + koos <- df_temp %>% select(Value = !!y_choice, Replica = !!g_choice) %>% filter(!is.na(Value)) + koos$Condition <- as.factor("1") + return(koos) + } else { koos <- df_temp %>% select(Condition = !!x_choice , Value = !!y_choice, Replica = !!g_choice) %>% filter(!is.na(Value)) - + } } + #Convert Condition and Replica into factors koos <- koos %>% mutate_at(vars(Condition, Replica), list(factor))