@@ -3,22 +3,26 @@ function (period = "LifeToDate", verbose = getOption('MTurkR.verbose', TRUE), ..
33 if (! period %in% c(" OneDay" , " SevenDays" , " ThirtyDays" , " LifeToDate" )) {
44 stop(" Period not valid" )
55 }
6- statistics <- c(" NumberAssignmentsAvailable" , " NumberAssignmentsAccepted" ,
7- " NumberAssignmentsPending" , " NumberAssignmentsApproved" ,
8- " NumberAssignmentsRejected" , " NumberAssignmentsReturned" ,
6+ statistics <- c(
7+ " NumberAssignmentsPending" , " NumberAssignmentsApproved" , " NumberAssignmentsRejected" ,
98 " NumberAssignmentsAbandoned" , " NumberHITsCreated" , " NumberHITsCompleted" ,
109 " NumberHITsAssignable" , " NumberHITsReviewable" , " PercentAssignmentsApproved" ,
1110 " PercentAssignmentsRejected" , " TotalRewardPayout" , " AverageRewardAmount" ,
12- " TotalRewardFeePayout" , " TotalFeePayout " , " TotalRewardAndFeePayout " ,
13- " TotalBonusPayout " , " TotalBonusFeePayout" , " EstimatedRewardLiability" ,
11+ " TotalRewardFeePayout" , " TotalBonusPayout " ,
12+ " TotalBonusFeePayout" , " EstimatedRewardLiability" ,
1413 " EstimatedFeeLiability" , " EstimatedTotalLiability" )
1514 z <- emptydf(length(statistics ), 2 , c(" Statistic" , " Value" ))
16- z [, 1 ] <- statistics
17- for (i in 1 : 20 ) {
18- z [i , 2 ] <- GetStatistic(statistics [i ], period = period , ... )
15+ z [[" Statistic" ]] <- statistics
16+ only_ltd <- c(" NumberHITsAssignable" , " EstimatedRewardLiability" , " EstimatedFeeLiability" , " EstimatedTotalLiability" )
17+ for (i in seq_along(statistics )) {
18+ if (statistics [i ] %in% only_ltd ) {
19+ if (statistics [i ] == " NumberHITsAssignable" && period != " LifeToDate" ) {
20+ message(" 'NumberHITsAssignable' is being retrieved for period 'LifeToDate'" )
21+ }
22+ z [i , 2 ] <- GetStatistic(statistics [i ], period = " LifeToDate" , verbose = verbose , ... )[[" Value" ]]
23+ } else {
24+ z [i , 2 ] <- GetStatistic(statistics [i ], period = period , verbose = verbose , ... )[[" Value" ]]
25+ }
1926 }
20- for (i in 21 : 23 ) {
21- z [i , 2 ] <- GetStatistic(statistics [i ], period = " LifeToDate" , ... )
22- }
2327 return (z )
2428}
0 commit comments