| Title: | hawkinR - Hawkin Dynamics API Client |
|---|---|
| Description: | Provides simple functionality with Hawkin Dynamics API. These functions are for use with 'Hawkin Dynamics Beta API' version 1.8-beta. You must be an Hawkin Dynamics user with active integration account to utilize functions within the package. This API is designed to get data out of your Hawkin Dynamics database into your own database. It is not designed to be accessed from client applications directly. There is a limit on the amount of data that can be returned in a single request. As your database grows, it will be necessary to use the from and to parameters to limit the size of the responses. Responses that exceed the memory limit will fail. |
| Authors: | Lauren Green [aut, cre] |
| Maintainer: | Lauren Green <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.2.4 |
| Built: | 2026-07-20 07:26:42 UTC |
| Source: | https://github.com/hawkindynamics/hawkinr |
Create a new athlete or athletes for an account. Bulk create up to 500 athletes at a time.
create_athletes(athleteData)create_athletes(athleteData)
athleteData |
A data frame of the athletes to be created. The data frame must follow the schema: |
The data frame passed as the argument must use the following schema:
| Column Name | Type | Inclusion | Description |
| name | chr | REQUIRED | athlete's given name (First Last) |
| image | chr | optional | URL path to image. default = null |
| active | logi | optional | athlete is active (TRUE). default = null |
| teams | list | optional | a single team id as a string or list of team ids. default = [defaultTeamId] |
| groups | list | optional | a single group id as a string or list of group ids. default = [] |
| external property | chr | optional | External properties can be added by adding any additional columns of equal length. The name of the column will become the external property name, and the row value will become the external property value. Use "lowercase" or "snake_case" styles for column names. |
If successful, a confirmation message will be printed with the number of successful athletes created. If there are failures, a data frame containing the athletes that failed to be created will be returned with columns:
| Column Name | Type | Description |
| reason | chr | Reason for failed creation |
| name | chr | Athlete's given name (First Last) |
## Not run: # Example data frame following the required schema df <- data.frame( name = c("John Doe", "Jane Smith"), image = c("http://example.com/johndoe.jpg", "http://example.com/janesmith.jpg"), active = c(TRUE, FALSE), teams = c("team1", c("team2", "team3"))), groups = c(NULL, "group1")), external_property = c("value1", "value2") ) # Create athletes using the example data frame create_athletes(athleteData = df) ## End(Not run)## Not run: # Example data frame following the required schema df <- data.frame( name = c("John Doe", "Jane Smith"), image = c("http://example.com/johndoe.jpg", "http://example.com/janesmith.jpg"), active = c(TRUE, FALSE), teams = c("team1", c("team2", "team3"))), groups = c(NULL, "group1")), external_property = c("value1", "value2") ) # Create athletes using the example data frame create_athletes(athleteData = df) ## End(Not run)
Use the Refresh Token generated to get a valid Access Token. Only the organization administrator account has the ability to generate API tokens.
get_access(`refreshToken`, `region` = "Americas", `org_name` = NULL)get_access(`refreshToken`, `region` = "Americas", `org_name` = NULL)
refreshToken |
Use the Refresh Token generated from 'https://cloud.hawkindynamics.com/integrations'. |
region |
The region to define the URL to be used. Options: "Americas" (default), "Europe", "Asia/Pacific". |
org_name |
The organization endpoint created by our tech support team. |
Use this function to initiate access to your data in the cloud. All other hawkinR functions will depend on the values returned from this function.
When correct inputs are passed through the region and refreshToken parameters, the returned
access token, expiration time, and regional URL will be stored in the system for use by other
functions during this session.
The accessToken is set to expire every 60 minutes. If the token has expired, and you attempt to use a dependent function, you will be prompted to run this function again to receive a new access token.
Shown as <org_name> in the API docs, the org_name parameter allows for custom configurations to take effect.
A data frame with necessary information for accessing API (access token, token expiration, URL region). The contents of the data frame are stored in the system environment.
## Not run: # This is an example of how the function would be called with the region defaulting to "Americas". # Replace 'refresh token' with an actual authentication token. get_access('refreshToken') # If you are in a different region and use one of the other URLs, declare your region by using the #`region` parameter. get_access('refreshToken', region = "Europe", org_name = "MyOrgName") ## End(Not run)## Not run: # This is an example of how the function would be called with the region defaulting to "Americas". # Replace 'refresh token' with an actual authentication token. get_access('refreshToken') # If you are in a different region and use one of the other URLs, declare your region by using the #`region` parameter. get_access('refreshToken', region = "Europe", org_name = "MyOrgName") ## End(Not run)
Get the athletes for an account. Inactive players will only be included if
includeInactive parameter is set to TRUE.
get_athletes(includeInactive = FALSE)get_athletes(includeInactive = FALSE)
includeInactive |
FALSE by default to exclude inactive players in database. Set to TRUE if you want inactive players included in the return. |
Response will be a data frame containing the athletes that match this query. Each athlete includes the following variables:
| Column Name | Type | Description |
| id | chr | athlete's unique ID |
| name | chr | athlete's given name (First Last) |
| active | bool | athlete is active (TRUE) |
| teams | chr | team ids separated by "," |
| groups | chr | group ids separated by "," |
| image | chr | URL to athlete's profile image |
| position | chr | athlete's position |
| dob | chr | athlete's date of birth |
| sport | chr | athlete's sport |
| height | chr | athlete's height |
| lastTestedOn | chr | date of athlete's last test |
| external | chr | external properties will have a column of their name with the appropriate values for the athlete of NA if it does not apply
|
## Not run: # This is an example of how the function would be called. If you only wish to call active players, # you don't need to provide any parameters. df_athletes <- get_athletes() # If you want to include all athletes, including inactive athletes, include the optional # `includeInactive` parameter. df_wInactive <- get_athletes( includeInactive = TRUE) ## End(Not run)## Not run: # This is an example of how the function would be called. If you only wish to call active players, # you don't need to provide any parameters. df_athletes <- get_athletes() # If you want to include all athletes, including inactive athletes, include the optional # `includeInactive` parameter. df_wInactive <- get_athletes( includeInactive = TRUE) ## End(Not run)
Get the force-time data for a specific test by id. This includes both left, right and combined force data at 1000hz (per millisecond). Calculated velocity, displacement, and power at each time interval will also be included.
get_forcetime(testId)get_forcetime(testId)
testId |
Give the unique test id of the trial you want to be called. |
Response will be a data frame containing the following:
| Column Name | Type | Description |
| time_s | int | Elapsed time in seconds, starting from end of identified quiet phase |
| force_right | int | Force recorded from the RIGHT platform coinciding with time point from time_s, measured in Newtons (N) |
| force_Left | int | Force recorded from the LEFT platform coinciding with time point from time_s, measured in Newtons (N) |
| force_combined | int | Sum of forces from LEFT and RIGHT, coinciding with time point from time_s, measured in Newtons (N) |
| velocity_m.s | int | Calculated velocity of center of mass at time interval, measured in meters per second (m/s) |
| displacement_m | int | Calculated displacement of center of mass at time interval, measured in meters (m) |
| power_w | int | Calculated power of mass at time interval, measured in watts (W) |
## Not run: # This is an example of how the function would be called. df_ft <- get_forcetime(testId = `stringId`) ## End(Not run)## Not run: # This is an example of how the function would be called. df_ft <- get_forcetime(testId = `stringId`) ## End(Not run)
Get the group names and ids for all the groups in the org.
get_groups()get_groups()
Response will be a data frame containing the groups that are in the organization. Each group has the following variables:
| Column Name | Type | Description |
| id | chr | group's unique ID |
| name | chr | group's given name |
## Not run: # This is an example of how the function would be called. df_groups <- get_groups() ## End(Not run)## Not run: # This is an example of how the function would be called. df_groups <- get_groups() ## End(Not run)
Get the metrics and ids for all the metrics in the system.
get_metrics(testType = "all")get_metrics(testType = "all")
testType |
Supply a value of type string. Must be canonical test Id, test type name, or test name abbreviation. Names | Abbreviations: "Countermovement Jump" | "CMJ", "Squat Jump" | "SJ", "Isometric Test" | "ISO", "Drop Jump" | "DJ", "Free Run" | "FREE", "CMJ Rebound" | "CMJR", "Multi Rebound" | "MR", "Weigh In" | "WI", "Drop Landing" | "DL", "TS Isometric Test" | "TSISO", "TS Free Run" | "TSFREE" |
Response will be a data frame containing the tests metrics that are in the HD system. The parameter
testType can be used to filter and return only metrics of the specified type.
The returned data frame will follow the following schema:
| Column Name | Type | Description |
| canonicalTestTypeID | chr | Canonical Test Id |
| testTypeName | chr | Given Test Name |
| id | chr | camelCase Test Name |
| label | chr | Outward facing label or title |
| label_unit | chr | Outward facing label or title w/ unit of measure |
| header | chr | header of data frame output |
| units | chr | Unit of measure (if any) |
| description | chr | Description or definition of metric |
## Not run: # This is an example of how the function would be called. df_testsMetrics <- get_metrics(testType = "CMJ") ## End(Not run)## Not run: # This is an example of how the function would be called. df_testsMetrics <- get_metrics(testType = "CMJ") ## End(Not run)
Get the tag names and ids for all the tags in the system.
get_tags()get_tags()
Response will be a data frame containing the tags that are in the organization. Each tag has the following variables:
| Column Name | Type | Description |
| id | chr | tag's unique ID |
| name | chr | tag's given name |
| description | chr | description of tag provided by user |
## Not run: # This is an example of how the function would be called. df_tags <- get_tags() ## End(Not run)## Not run: # This is an example of how the function would be called. df_tags <- get_tags() ## End(Not run)
Get the team names and ids for all the teams in the org.
get_teams()get_teams()
Response will be a data frame containing the teams that are in the organization. Each team has the following variables:
| Column Name | Type | Description |
| id | chr | team's unique ID |
| name | chr | team's given name |
## Not run: # This is an example of how the function would be called. df_teams <- get_teams() ## End(Not run)## Not run: # This is an example of how the function would be called. df_teams <- get_teams() ## End(Not run)
Get the tests for an account. You can specify a time frame from, or to, which the tests should come (or be synced).
get_tests( from = NULL, to = NULL, sync = FALSE, athleteId = NULL, typeId = NULL, teamId = NULL, groupId = NULL, includeInactive = FALSE )get_tests( from = NULL, to = NULL, sync = FALSE, athleteId = NULL, typeId = NULL, teamId = NULL, groupId = NULL, includeInactive = FALSE )
from |
Optionally supply a time frame start value. Accepts either:
If not supplied, all available tests from the earliest record will be returned. Use this parameter for bulk exports or to define a starting point for data retrieval. |
to |
Optionally supply a time frame end value. Accepts either:
If not supplied, all available tests up to the latest record will be returned,
or up to the |
sync |
The result set will include updated and newly created tests. This parameter is best suited to keep your database in sync with the Hawkin database. If you do not supply this value you will receive every test. |
athleteId |
Supply an athlete’s id to receive tests for a specific athlete |
typeId |
Supply a value of type string. Must be canonical test Id, test type name, or test name abbreviation. Names | Abbreviations: "Countermovement Jump" | "CMJ", "Squat Jump" | "SJ", "Isometric Test" | "ISO", "Drop Jump" | "DJ", "Free Run" | "FREE", "CMJ Rebound" | "CMJR", "Multi Rebound" | "MR", "Weigh In" | "WI", "Drop Landing" | "DL", "TS Free Run" | "TSFR", "TS Isometric Test" | "TSISO" |
teamId |
Supply a team’s ID, a list of team IDs, or a string of a comma separated team id’s to receive tests from the specified teams. A maximum of 10 teams can be fetched at once. |
groupId |
Supply a group’s ID, a list of group IDs, or a string of a comma separated group id’s to receive tests from the specified groups. A maximum of 10 groups can be fetched at once. |
includeInactive |
There was a change to the default API configuration to reflect
the majority of users API configuration. Inactive tests or tests where |
Response will be a data frame containing the trials within the time range (if specified).
| Column Name | Type | Description |
| id | str | Test trial unique ID |
| active | logi | The trial is active and not disabled |
| timestamp | int | UNIX time stamp of trial |
| segment | chr | Description of the test type and trial |
| number of the session (testType:trialNo) | ||
| test_type_id | chr | Id of the test type of the trial |
| test_type_name | chr | Name of the test type of the trial |
| test_type_canonicalId | chr | Canonical Id of the test type of the trial |
| test_type_tag_ids | chr | String of Ids associated with tags used during |
| the test trial | ||
| test_type_tag_names | chr | String of names of tags used during the |
| test trial | ||
| test_type_tag_desc | chr | String of descriptions of tags used during |
| the test trial | ||
| athlete_id | chr | Unique Id of the athlete |
| athlete_name | chr | Athlete given name |
| athlete_active | logi | The athlete is active |
| athlete_teams | list | List containing Ids of each team the athlete is on |
| athlete_groups | list | List containing Ids of each group the athlete is in |
| athlete_image | chr | URL to athlete's profile image |
| athlete_position | chr | Athlete's position |
| athlete_dob | chr | Athlete's date of birth |
| athlete_sport | chr | Athlete's sport |
| athlete_height | chr | Athlete's height |
All metrics from each test type are included as the remaining variables
unless typeId is provided, then only the metrics of that test type will be returned.
If a trial does not have data for a variable it is returned NA.
## Not run: # This is an example of how the function would be called. # Call for all tests dfAllTests <- get_tests() # Call for all tests within a specific time frame dfFromTo <- get_tests(from = 1689958617, to = 1691207356) # Call for all new tests since a specific date, or any tests that have been updated/changed since that date dfSync <- get_tests(from = 1689958617, sync=TRUE) ## End(Not run)## Not run: # This is an example of how the function would be called. # Call for all tests dfAllTests <- get_tests() # Call for all tests within a specific time frame dfFromTo <- get_tests(from = 1689958617, to = 1691207356) # Call for all new tests since a specific date, or any tests that have been updated/changed since that date dfSync <- get_tests(from = 1689958617, sync=TRUE) ## End(Not run)
Deprecated: Use get_tests instead, which has been expanded to handle all requests.
Get only tests of the specified athlete for an account.
get_tests_ath(athleteId, from = NULL, to = NULL, sync = FALSE, includeInactive = FALSE)get_tests_ath(athleteId, from = NULL, to = NULL, sync = FALSE, includeInactive = FALSE)
athleteId |
Supply an athlete’s id to receive tests for a specific athlete |
from |
Optionally supply a time frame start value. Accepts either:
If not supplied, all available tests from the earliest record will be returned. Use this parameter for bulk exports or to define a starting point for data retrieval. |
to |
Optionally supply a time frame end value. Accepts either:
If not supplied, all available tests up to the latest record will be returned,
or up to the |
sync |
The result set will include updated and newly created tests. This parameter is best suited to keep your database in sync with the Hawkin database. If you do not supply this value you will receive every test. |
includeInactive |
There was a change to the default API configuration to reflect the majority of
users API configuration. Inactive tests or tests where |
Response will be a data frame containing the trials within the time range (if specified).
| Column Name | Type | Description |
| id | str | Test trial unique ID |
| active | logi | The trial is active and not disabled |
| timestamp | int | UNIX time stamp of trial |
| segment | chr | Description of the test type and trial number of the session (testType:trialNo) |
| test_type_id | chr | Id of the test type of the trial |
| test_type_name | chr | Name of the test type of the trial |
| test_type_canonicalId | chr | Canonical Id of the test type of the trial |
| test_type_tag_ids | chr | String of Ids associated with tags used during the test trial |
| test_type_tag_names | chr | String of names of tags used during the test trial |
| test_type_tag_desc | chr | String of descriptions of tags used during the test trial |
| athlete_id | chr | Unique Id of the athlete |
| athlete_name | chr | Athlete given name |
| athlete_active | logi | The athlete is active |
| athlete_teams | list | List containing Ids of each team the athlete is on |
| athlete_groups | list | List containing Ids of each group the athlete is in |
All metrics from each test type are included as the remaining variables. If a trial does not have data for a variable it is returned NA.
get_tests
## Not run: # This is an example of how the function would be called. ## Call for all tests from a specified athlete df_cmj <- get_tests_ath(athleteId = "athleteId") ## Call for all tests within a specific time frame dfFromTo <- get_tests_ath(athleteId = "athleteId", from = 1689958617, to = 1691207356) ## Call for all tests since a specific date dfSince <- get_tests_ath("athleteId", from = 1689958617) ## End(Not run)## Not run: # This is an example of how the function would be called. ## Call for all tests from a specified athlete df_cmj <- get_tests_ath(athleteId = "athleteId") ## Call for all tests within a specific time frame dfFromTo <- get_tests_ath(athleteId = "athleteId", from = 1689958617, to = 1691207356) ## Call for all tests since a specific date dfSince <- get_tests_ath("athleteId", from = 1689958617) ## End(Not run)
Deprecated: Use get_tests instead, which has been expanded to handle all requests.
Get only tests of the specified group for an account.
get_tests_group(groupId, from = NULL, to = NULL, sync = FALSE, includeInactive = FALSE)get_tests_group(groupId, from = NULL, to = NULL, sync = FALSE, includeInactive = FALSE)
groupId |
Supply a group’s ID, a list of group IDs, or a string of a comma separated group id’s to receive tests from the specified groups. A maximum of 10 groups can be fetched at once. |
from |
Optionally supply a time frame start value. Accepts either:
If not supplied, all available tests from the earliest record will be returned. Use this parameter for bulk exports or to define a starting point for data retrieval. |
to |
Optionally supply a time frame end value. Accepts either:
If not supplied, all available tests up to the latest record will be returned,
or up to the |
sync |
The result set will include updated and newly created tests. This parameter is best suited to keep your database in sync with the Hawkin database. If you do not supply this value you will receive every test. |
includeInactive |
There was a change to the default API configuration to reflect the majority of
users API configuration. Inactive tests or tests where |
Response will be a data frame containing the trials within the time range (if specified).
| Column Name | Type | Description |
| id | str | Test trial unique ID |
| active | logi | The trial is active and not disabled |
| timestamp | int | UNIX time stamp of trial |
| segment | chr | Description of the test type and trial number of the session (testType:trialNo) |
| test_type_id | chr | Id of the test type of the trial |
| test_type_name | chr | Name of the test type of the trial |
| test_type_canonicalId | chr | Canonical Id of the test type of the trial |
| test_type_tag_ids | chr | String of Ids associated with tags used during the test trial |
| test_type_tag_names | chr | String of names of tags used during the test trial |
| test_type_tag_desc | chr | String of descriptions of tags used during the test trial |
| athlete_id | chr | Unique Id of the athlete |
| athlete_name | chr | Athlete given name |
| athlete_active | logi | The athlete is active |
| athlete_teams | list | List containing Ids of each team the athlete is on |
| athlete_groups | list | List containing Ids of each group the athlete is in |
All metrics from each test type are included as the remaining variables. If a trial does not have data for a variable it is returned NA.
get_tests
## Not run: # This is an example of how the function would be called. ## Call for all tests by Group 1 dfGroup1 <- get_tests_group(groupId = "group1") ## Call for all tests from Groups 1 & 2 dfGroups_1_2 <- get_tests_group(groupId = paste0("group1","group2")) ## Call for all Group 1 tests since a specific date df_Group1_Since <- get_tests_group("group1", from = 1689958617) ## End(Not run)## Not run: # This is an example of how the function would be called. ## Call for all tests by Group 1 dfGroup1 <- get_tests_group(groupId = "group1") ## Call for all tests from Groups 1 & 2 dfGroups_1_2 <- get_tests_group(groupId = paste0("group1","group2")) ## Call for all Group 1 tests since a specific date df_Group1_Since <- get_tests_group("group1", from = 1689958617) ## End(Not run)
Deprecated: Use get_tests instead, which has been expanded to handle all requests.
Get only tests of the specified team for an account.
get_tests_team(teamId, from = NULL, to = NULL, sync = FALSE, includeInactive = FALSE)get_tests_team(teamId, from = NULL, to = NULL, sync = FALSE, includeInactive = FALSE)
teamId |
Supply a team’s ID, a list of team IDs, or a string of a comma separated team id’s to receive tests from the specified teams. A maximum of 10 teams can be fetched at once. |
from |
Optionally supply a time frame start value. Accepts either:
If not supplied, all available tests from the earliest record will be returned. Use this parameter for bulk exports or to define a starting point for data retrieval. |
to |
Optionally supply a time frame end value. Accepts either:
If not supplied, all available tests up to the latest record will be returned,
or up to the |
sync |
The result set will include updated and newly created tests. This parameter is best suited to keep your database in sync with the Hawkin database. If you do not supply this value you will receive every test. |
includeInactive |
There was a change to the default API configuration to reflect the majority of
users API configuration. Inactive tests or tests where |
Response will be a data frame containing the trials within the time range (if specified).
| Column Name | Type | Description |
| id | str | Test trial unique ID |
| active | logi | The trial is active and not disabled |
| timestamp | int | UNIX time stamp of trial |
| segment | chr | Description of the test type and trial number of the session (testType:trialNo) |
| test_type_id | chr | Id of the test type of the trial |
| test_type_name | chr | Name of the test type of the trial |
| test_type_canonicalId | chr | Canonical Id of the test type of the trial |
| test_type_tag_ids | chr | String of Ids associated with tags used during the test trial |
| test_type_tag_names | chr | String of names of tags used during the test trial |
| test_type_tag_desc | chr | String of descriptions of tags used during the test trial |
| athlete_id | chr | Unique Id of the athlete |
| athlete_name | chr | Athlete given name |
| athlete_active | logi | The athlete is active |
| athlete_teams | list | List containing Ids of each team the athlete is on |
| athlete_groups | list | List containing Ids of each group the athlete is in |
All metrics from each test type are included as the remaining variables. If a trial does not have data for a variable it is returned NA.
get_tests
## Not run: # This is an example of how the function would be called. ## Call for all tests by Group 1 dfteam1 <- get_tests_team(teamId = "team1") ## Call for all tests from Groups 1 & 2 dfteam_1_2 <- get_tests_team(teamId = paste0("team1","team2")) ## Call for all Group 1 tests since a specific date df_team1_Since <- get_tests_team("team1", from = 1689958617) ## End(Not run)## Not run: # This is an example of how the function would be called. ## Call for all tests by Group 1 dfteam1 <- get_tests_team(teamId = "team1") ## Call for all tests from Groups 1 & 2 dfteam_1_2 <- get_tests_team(teamId = paste0("team1","team2")) ## Call for all Group 1 tests since a specific date df_team1_Since <- get_tests_team("team1", from = 1689958617) ## End(Not run)
Deprecated: Use get_tests instead, which has been expanded to handle all requests.
Get only tests of the specified type for an account.
get_tests_type(typeId, from = NULL, to = NULL, sync = FALSE, includeInactive = FALSE)get_tests_type(typeId, from = NULL, to = NULL, sync = FALSE, includeInactive = FALSE)
typeId |
Supply a value of type string. Must be canonical test Id, test type name, or test name abbreviation. Names | Abbreviations: "Countermovement Jump" | "CMJ", "Squat Jump" | "SJ", "Isometric Test" | "ISO", "Drop Jump" | "DJ", "Free Run" | "FREE", "CMJ Rebound" | "CMJR", "Multi Rebound" | "MR", "Weigh In" | "WI", "Drop Landing" | "DL", "TS Free Run" | "TSFR", "TS Isometric Test" | "TSISO" |
from |
Optionally supply a time frame start value. Accepts either:
If not supplied, all available tests from the earliest record will be returned. Use this parameter for bulk exports or to define a starting point for data retrieval. |
to |
Optionally supply a time frame end value. Accepts either:
If not supplied, all available tests up to the latest record will be returned,
or up to the |
sync |
The result set will include updated and newly created tests. This parameter is best suited to keep your database in sync with the Hawkin database. If you do not supply this value you will receive every test. |
includeInactive |
There was a change to the default API configuration to reflect the majority of
users API configuration. Inactive tests or tests where |
Response will be a data frame containing the trials within the time range (if specified).
| Column Name | Type | Description |
| id | str | Test trial unique ID |
| active | logi | The trial is active and not disabled |
| timestamp | int | UNIX time stamp of trial |
| segment | chr | Description of the test type and trial number of the session (testType:trialNo) |
| test_type_id | chr | Id of the test type of the trial |
| test_type_name | chr | Name of the test type of the trial |
| test_type_canonicalId | chr | Canonical Id of the test type of the trial |
| test_type_tag_ids | chr | String of Ids associated with tags used during the test trial |
| test_type_tag_names | chr | String of names of tags used during the test trial |
| test_type_tag_desc | chr | String of descriptions of tags used during the test trial |
| athlete_id | chr | Unique Id of the athlete |
| athlete_name | chr | Athlete given name |
| athlete_active | logi | The athlete is active |
| athlete_teams | list | List containing Ids of each team the athlete is on |
| athlete_groups | list | List containing Ids of each group the athlete is in |
Only metrics of the given test type are included as the remaining variables.
get_tests
## Not run: # This is an example of how the function would be called. ## Call for all CMJ tests df_cmj <- get_tests_type(typeId = "7nNduHeM5zETPjHxvm7s") ## Call for Free Run tests within a specific time frame df_free <- get_tests_type(typeId = "5pRSUQVSJVnxijpPMck3", from = 1689958617, to = 1691207356) ## Call for Squat Jump tests since a specific date df_sjSince <- get_tests_type("QEG7m7DhYsD6BrcQ8pic", from = 1689958617) ## End(Not run)## Not run: # This is an example of how the function would be called. ## Call for all CMJ tests df_cmj <- get_tests_type(typeId = "7nNduHeM5zETPjHxvm7s") ## Call for Free Run tests within a specific time frame df_free <- get_tests_type(typeId = "5pRSUQVSJVnxijpPMck3", from = 1689958617, to = 1691207356) ## Call for Squat Jump tests since a specific date df_sjSince <- get_tests_type("QEG7m7DhYsD6BrcQ8pic", from = 1689958617) ## End(Not run)
Get the test type names and ids for all the test types in the system.
get_testTypes()get_testTypes()
Response will be a data frame containing the tests that are in the HD system. Each test type includes the following variables:
| Column Name | Type | Description |
| canonicalId | chr | test's unique canonical ID |
| name | chr | test's given name |
| abbreviation | chr | test given name abbreviation |
## Not run: # This is an example of how the function would be called. df_tests <- get_testTypes() ## End(Not run)## Not run: # This is an example of how the function would be called. df_tests <- get_testTypes() ## End(Not run)
This function initializes the logger with customization parameters, including the output destination and log thresholds for both stdout and log file.
initialize_logger( log_output = "stdout", log_threshold_stdout = "INFO", log_file = "hawkinRlog.log", log_threshold_file = "INFO" )initialize_logger( log_output = "stdout", log_threshold_stdout = "INFO", log_file = "hawkinRlog.log", log_threshold_file = "INFO" )
log_output |
A character string specifying the log output destination. Options are "stdout", "file", or "both". Default is "stdout". |
log_threshold_stdout |
A character string specifying the log threshold for stdout. Options are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL". Default is "INFO". |
log_file |
A character string specifying the name of the custom log file. |
log_threshold_file |
A character string specifying the log threshold for the log file. Options are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL". Default is "INFO". |
The function sets up the logging configuration with the specified output destination
and log thresholds. If "stdout" is chosen, logs will be output to the console.
If "file" is chosen, logs will be written to a file named "hawkinRlog.log" by default.
The log_file parameter can be used to use a different file name and location.
If "both" is chosen, logs will be output to both the console and the log file.
Users can specify different log thresholds for stdout and log file.
## Not run: # Log messages as stdout with a DEBUG threshold initialize_logger(log_output = "stdout", log_threshold_stdout = "DEBUG") # Log to file in 'app' directory with a TRACE threshold initialize_logger( log_output = "file", log_file = "app/mylog", log_threshold_file = "TRACE" ) ## End(Not run)## Not run: # Log messages as stdout with a DEBUG threshold initialize_logger(log_output = "stdout", log_threshold_stdout = "DEBUG") # Log to file in 'app' directory with a TRACE threshold initialize_logger( log_output = "file", log_file = "app/mylog", log_threshold_file = "TRACE" ) ## End(Not run)
This data frame contains metrics from all tests.
MetricDictionaryMetricDictionary
A data frame with 484 rows and 7 variables:
The unique id of the canonical test type (character).
The given / common name of the test type (character).
PascalCase formatted name of the metric (character).
The metric label found in app and cloud UI (character).
The metric name returned from the API (character).
header of data frame output (character).
Metric unit of measure (character).
A verbose description of the metric (character).
Generated for demonstration purposes.
Update an athlete or athletes for an account. Bulk update up to 500 athletes at a time.
update_athletes(athleteData)update_athletes(athleteData)
athleteData |
Provide a data frame of the athlete or athletes to be updated. |
The data frame passed as the argument must use the following schema:
| Column Name | Type | Inclusion | Description |
| id | chr | REQUIRED | athlete's Hawkin Dynamics unique ID |
| name | chr | optional | athlete's given name (First Last) |
| image | chr | optional | URL path to image. default = null |
| active | logi | optional | athlete is active (TRUE). default = null |
| teams | list | optional | a single team id as a string or list of team ids. default = [defaultTeamId] |
| groups | list | optional | a single group id as a string or list of group ids. default = [] |
| external property | chr | optional | External properties can be added by adding any additional columns of equal length. The name of the column will become the external property name, and the row value will become the external property value. Use "lowercase" or "snake_case" styles for column names. |
If optional fields are not present in an update request, those properties will be left unchanged. However, when updating external properties, custom properties that are not present will be removed.
If successful, a confirmation message will be printed with the number of successful athletes created. If there are failures, a data frame containing the athletes that failed to be created will be returned with columns:
| Column Name | Type | Description |
| reason | chr | Reason for failed creation |
| name | chr | Athlete's given name (First Last) |
## Not run: # Example data frame following the required schema df <- data.frame( id = c("uniqueAthleteIdOne", "uniqueAthleteIdTwo"), name = c("John Doe", "Jane Smith"), image = c("http://example.com/johndoe.jpg", "http://example.com/janesmith.jpg"), active = c(TRUE, FALSE), teams = c("team1", c("team2", "team3"))), groups = c(NULL, "group1")), external_property = c("value1", "value2") ) # Update athletes using the example data frame update_athletes(athleteData = df) ## End(Not run)## Not run: # Example data frame following the required schema df <- data.frame( id = c("uniqueAthleteIdOne", "uniqueAthleteIdTwo"), name = c("John Doe", "Jane Smith"), image = c("http://example.com/johndoe.jpg", "http://example.com/janesmith.jpg"), active = c(TRUE, FALSE), teams = c("team1", c("team2", "team3"))), groups = c(NULL, "group1")), external_property = c("value1", "value2") ) # Update athletes using the example data frame update_athletes(athleteData = df) ## End(Not run)