Skip to content

Commit c54417e

Browse files
authored
Merge pull request #46 from mcguinlu/mcguinlu-patch
Fix factor levels of rob_summary() and update the README
2 parents 9a9fdd4 + afe5b6f commit c54417e

10 files changed

+8
-22
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
^\.github$
1010
^appveyor\.yml$
1111
^codecov\.yml$
12+
^.mergify\.yml$

R/rob_summary.R

+7-20
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,12 @@ if (tool == "ROB2") {
7777
domain, judgement,
7878
-Weights))
7979

80-
rob.tidy$judgement <- as.factor(rob.tidy$judgement)
81-
8280
rob.tidy$domain <- as.factor(rob.tidy$domain)
8381

8482
rob.tidy$domain <- factor(rob.tidy$domain,
8583
levels(rob.tidy$domain)[c(6, 5, 4, 3, 2, 1)])
8684

87-
rob.tidy$judgement <- factor(rob.tidy$judgement,
88-
levels(rob.tidy$judgement)[c(2, 3, 1)])
85+
rob.tidy$judgement <- factor(rob.tidy$judgement,levels = c("h", "s","l" ))
8986

9087
# Create plot
9188
plot <- ggplot2::ggplot(data = rob.tidy) +
@@ -198,15 +195,13 @@ if (tool == "ROB2") {
198195
domain, judgement,
199196
-Weights))
200197

201-
rob.tidy$judgement <- as.factor(rob.tidy$judgement)
202-
203198
rob.tidy$domain <- as.factor(rob.tidy$domain)
204199

205200
rob.tidy$domain <- factor(rob.tidy$domain,
206201
levels(rob.tidy$domain)[c(8, 7, 6, 3, 2, 5, 4, 1)])
207202

208-
rob.tidy$judgement <- factor(rob.tidy$judgement,
209-
levels(rob.tidy$judgement)[c(1,4,3,2)])
203+
204+
rob.tidy$judgement <- factor(rob.tidy$judgement,levels = c("c","s", "m","l" ))
210205

211206
plot <- ggplot2::ggplot(data = rob.tidy) +
212207
ggplot2::geom_bar(
@@ -324,15 +319,12 @@ if (tool == "ROB2") {
324319
domain, judgement,
325320
-Weights))
326321

327-
rob.tidy$judgement <- as.factor(rob.tidy$judgement)
328-
329322
rob.tidy$domain <- as.factor(rob.tidy$domain)
330323

331324
rob.tidy$domain <- factor(rob.tidy$domain,
332325
levels(rob.tidy$domain)[c(8, 7, 6, 3, 2, 5, 4, 1)])
333326

334-
rob.tidy$judgement <- factor(rob.tidy$judgement,
335-
levels(rob.tidy$judgement)[c(1,4,3,2)])
327+
rob.tidy$judgement <- factor(rob.tidy$judgement,levels = c("c","s", "m","l" ))
336328

337329
plot <- ggplot2::ggplot(data = rob.tidy) +
338330
ggplot2::geom_bar(
@@ -440,12 +432,9 @@ if (tool == "QUADAS-2") {
440432
domain, judgement,
441433
-Weights))
442434

443-
rob.tidy$judgement <- as.factor(rob.tidy$judgement)
444-
445435
rob.tidy$domain <- as.factor(rob.tidy$domain)
446436

447-
rob.tidy$judgement <- factor(rob.tidy$judgement,
448-
levels(rob.tidy$judgement)[c(2, 3, 1)])
437+
rob.tidy$judgement <- factor(rob.tidy$judgement,levels = c("h", "s","l" ))
449438

450439
if(overall==TRUE) {
451440
rob.tidy$domain <- factor(rob.tidy$domain,
@@ -529,6 +518,7 @@ if (tool == "QUADAS-2") {
529518
data[[i]] <- trimws(data[[i]])
530519
data[[i]] <- substr(data[[i]], 0, 1)
531520
data[[i]] <- gsub("u","s",data[[i]])
521+
data[[i]] <- gsub("m","s",data[[i]])
532522
}
533523

534524
# Define weights if FALSE and check if there is a weight column if TRUE
@@ -561,10 +551,7 @@ if (tool == "QUADAS-2") {
561551
domain, judgement,
562552
-Weights))
563553

564-
rob.tidy$judgement <- as.factor(rob.tidy$judgement)
565-
566-
rob.tidy$judgement <- factor(rob.tidy$judgement,
567-
levels(rob.tidy$judgement)[c(2, 3, 1)])
554+
rob.tidy$judgement <- factor(rob.tidy$judgement,levels = c("h", "s","l" ))
568555

569556
for (i in 1:(ncol(data.tmp)-1)) {
570557
levels(rob.tidy$domain)[i] <- colnames(data.tmp)[i]

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ of bias in systematic reviews).
110110
[1] "ROBINS-I"
111111
[1] "QUADAS-2"
112112
[1] "ROB1"
113-
[1] "ROBINS-I Online"
114113

115114
## Advanced usage
116115

@@ -192,4 +191,3 @@ file for details.
192191
`ggplot2` coding issues.
193192
- [Eliza Grames](https://github.com/elizagrames) for creating the
194193
`robvis` hex sticker.
195-
2 Bytes
Loading
4 Bytes
Loading
1 Byte
Loading
2 Bytes
Loading
3 Bytes
Loading
0 Bytes
Loading

man/figures/rob2trafficlight.png

-655 Bytes
Loading

0 commit comments

Comments
 (0)