Learn R Programming

RDota2 (version 0.1.6)

key_actions: This function makes the key accessible to all functions.

Description

key_actions will allow the user to register (set), get (retrieve) or delete the key.

Usage

key_actions(action = c("register_key", "get_key", "delete_key"), value = NULL)

Arguments

action
Which action to perform. Check the details.
value
The steam key to use. It is used only in the register_key action. If you do not have a key, you can get one at https://steamcommunity.com/dev.

Value

A dota_api object containing the elements described in the details.

Details

There are three actions that can be performed in this function:
  • register_key This action sets the key and at the same time makes it available to all the other functions. The key argument in the api calls (i.e. functions) should not be used after setting the key with key_actions. It is good practice to store the key in an environment variable in .Renviron and then use Sys.getenv() to retrieve it. This technique is described in detail in https://github.com/LyzandeR/RDota2 in the readme file.
  • get_key Returns the current key.
  • delete_key Deletes the key.

Examples

Run this code
## Not run: 
# key_actions(action = 'register_key', value = Sys.getenv('RDota_KEY'))
# key_actions(action = 'register_key', value = 'xxxxxxxxxxxxx')
# key_actions(action = 'get_key')
# key_actions(action = 'delete_key')
# ## End(Not run)

Run the code above in your browser using DataLab