Learn R Programming

MTurkR (version 0.2)

AccountBalance: Retrieve MTurk account balance

Description

Retrieves the amount of money (in US Dollars) in your MTurk account. SufficientFunds provides a wrapper that checks whether your account has sufficient funds based upon specified characters of your HIT.

Usage

AccountBalance(	keypair = credentials(), print = TRUE, browser = FALSE, 
				log.requests = TRUE, sandbox = FALSE)

SufficientFunds(amount, assignments = NULL, hits = NULL, 
				bonus.ct = NULL, bonus.amount = NULL, masters = FALSE, 
				turkfee = 0.1, turkmin = 0.005, mastersfee = 0.2, 
				keypair = credentials(), print = TRUE, 
				log.requests = TRUE, sandbox = FALSE)

Arguments

amount
Intended per-assignment payment amount.
assignments
Number of intended assignments (per HIT, if multiple HITs).
hits
Number of HITs.
bonus.ct
Number of intended bonuses.
bonus.amount
Amount of each bonus.
masters
A logical indicating whether MTurk Masters will be used. Default is FALSE.
turkfee
Amazon's fee as percentage of payments. Default is 10-percent (as 0.10).
turkmin
Amazon's minimum per-assignment fee. Default is $0.005.
mastersfee
Amazon's additional charge for use of MTurk Masters. Default is 20-percent (as 0.20).
keypair
A two-item character vector containing an AWS Access Key ID in the first position and the corresponding Secret Access Key in the second position. Set default with credentials.
print
Optionally print the results of the API request to the standard output. Default is TRUE.
browser
Optionally open the request in the default web browser, rather than opening in R. Default is FALSE.
log.requests
A logical specifying whether API requests should be logged. Default is TRUE. See readlogfile for details.
sandbox
Optionally execute the request in the MTurk sandbox rather than the live server. Default is FALSE.

Value

  • Return value is a character string of the format $10,000.00.

Details

AccountBalance takes no substantive arguments. SufficientFunds is a wrapper for AccountBalance that accepts as inputs information about intended payments and bonuses to check whether your account has sufficient funds. If sandbox=TRUE, AccountBalance always returns $10,000.00. accountbalance() and getbalance() are aliases for AccountBalance.

References

http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMturkAPI/ApiReference_GetAccountBalanceOperation.html{API Reference}

Examples

Run this code
AccountBalance()
SufficientFunds(amount=".25",assignments="50",hits="5")
SufficientFunds(bonus.ct="150",bonus.amount=".75")

Run the code above in your browser using DataLab