Package 'numetricApi'

Title: Functions to use Numetric's API
Description: Functions for accessing and manipulating datasets and dashboards in Numetric. You need an API key and dataset Ids and dashboard Ids.
Authors: Ronald Guymon <[email protected]>
Maintainer: Ronald Guymon <[email protected]>
License: Numetric
Version: 0.1.0
Built: 2025-01-01 02:49:00 UTC
Source: https://github.com/RonGuymon/numetricAPI

Help Index


Add rows to a dataset (V2)

Description

Adds data to a new or existing dataset. If the primary key already exists in the indexed data, then the old data will be replaced with the new data.

If the primary key doesn't already exist in the dataset, then the new data will be added on to the existing data.

This function uses the V2 version of the API.

Usage

addRows(apiKey, datasetId, dataframeName, chunkSize = 1500, printSample = F,
  nullArrays = F)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

datasetId

The dataset ID, in quotes. It can be found by using the getDatasets function, or by navigating to the dataset in Numetric, and selecting the string after the last forward slash.

dataframeName

The name of the dataframe, without quotes.

chunkSize

Defaults to 1,500 rows.

printSample

Defaults to False. If set to True, then it will return a sample of the data that is being indexed to verify that it's correctly being converted to JSON.

nullArrays

Defaults to False. Set to true if your data has arrays within a cell, and if some of those arrays have NULL values.

Value

Returns the status (e.g., 200, 401).


Add rows to a dataset (V3)

Description

Adds data to a new or existing dataset. If the primary key already exists in the indexed data, then the old data will be replaced with the new data.

If the primary key doesn't already exist in the dataset, then the new data will be added on to the existing data.

This function uses the V3 version of the API.

Usage

addRowsV3(apiKey, datasetId, dataframeName, chunkSize = 1500,
  printSample = F, nullArrays = F)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

datasetId

The dataset ID, in quotes. It can be found by using the getDatasets function, or by navigating to the dataset in Numetric, and selecting the string after the last forward slash.

dataframeName

The name of the dataframe, without quotes.

chunkSize

Defaults to 1,500 rows.

printSample

Defaults to False. If set to True, then it will return a sample of the data that is being indexed to verify that it's correctly being converted to JSON.

nullArrays

Defaults to False. Set to true if your data has arrays within a cell, and if some of those arrays have NULL values.

Value

Returns the status (e.g., 200, 401).


Bucket query a Numetric dataset (V2)

Description

Returns a dataframe with a list of bucket variable values, and the number of observations for each bucket.

This is especially useful when you have a dataset larger than 10,000 rows because it allows you to create a loop through the data getting only the data for each bucket.

This function uses the V2 version of the API.

Usage

bucketQuery(apiKey, datasetId, bucketVar, filterType = "none", filterField,
  filterValue, customFilterValue, must = "true", lowerBound, upperBound,
  childField, childOperation)

Arguments

apiKey

The API key, in quotes. You can find the API key in the settings after logging into Numetric

datasetId

The dataset ID, in quotes. The dataset ID can be found by using the getDatasets function, or by navigating to the dataset in Numetric, and selecting the string after the last forward slash.

bucketVar

The name of the dataset column, in quotes, that will be used to bucket the data.

filterType

The type of filter to apply. Options are "term", "range", "custom", or "none". Default value is "none".

filterField

The name of the column, in quotes, to use as a filter. This should not used when the filterType is "custom".

filterValue

This is only used when applying a term filter. The value in quotes, is what will be included. (If the must argument is set to "false", then this will be an exclude filter.) This should not used when the filterType is "custom".

customFilterValue

This is used in conjunction with a custom filterType. The format should be: "filter": "term", "field": "fieldName", "value": "value"

must

Whether the term filter is an include or excludes filter. By default it's set to "true", which is an includes filter. If set to "false", then it will be an excludes term filter.

lowerBound

This lower end of the range, lower boundary included, which is only specified when applying a range filter. The value, in quotes, should either be a date string formatted as "2017-06-02T00:00:00.000", or a number.

upperBound

This upper end of the range, upper boundary included, which is only specified when applying a range filter. The value, in quotes, should either be a date string formatted as "2017-06-02T00:00:00.000", or a number.

childField

The name of a column, in quotes, that you want to perform an operation on.

childOperation

The name of an operation (avg, sum, cardinality), in quotes, to perform on a child.

Value

Returns a dataframe.


Creates a new dashboard in Numetric (V2)

Description

Creates a new dashboard in Numetric.

This function uses the V2 version of the API.

Usage

createDashboard(apiKey, name = "None", category = "None", content)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

name

The name of the dashboard, in quotes, in Numetric. Defaults to "None".

content

JSON formatted string of text. See https://nrl.readme.io/docs for more information.


Create a new dataset (V2)

Description

Create a new dataset in a Numetric Org.

This function uses the V2 version of the API.

Usage

createDataset(apiKey, numetricName, dataframeName, category = "New Data",
  primaryKey, autocompletes = "", geoshapes = "", geopoints = "",
  boolean = "", everyone = "false")

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

numetricName

The name, in quotes, given to the dataset in the Numetric Warehouse.

dataframeName

The name, without quotes, of the dataframe that will be used to create the dataset in Numetric.

category

The category, in quotes, given to the dataset in the Numetric Warehouse.

autocompletes

The column name, or vector of column names, in quotes, that will autocomplete in the Numetric quick search bar.

geoshapes

The column name, or vector of column names, in quotes, that will be stored as a geoShape (point on a map). This needs to be in the format, "lat,long".

geopoints

The column name, or vector of column names, in quotes, that will be stored as a geoPoint (for heatmaps). This needs to be in the format, "lat,long".

boolean

The column name, or vector of column names, in quotes, that will be stored as True/False. True = 1, False = 0.

everyone

Defaults to "false". If set to "true", then it will allow everyone in the org to see the dataset.

id

The name of the column, in quotes, that will be used as the primary key. Each row should have a unique id, otherwise, the last row indexed will be the one saved.

Value

Returns the dataset id as a string.


Create a new table (V3)

Description

Create a new table in a Numetric Org.

This function uses the V3 version of the API.

Usage

createTable(apiKey, numetricName, dataframeName, category = "New Data",
  primaryKey, geoshapes = "", geopoints = "", boolean = "",
  everyone = "false")

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

numetricName

The name, in quotes, given to the dataset in the Numetric Warehouse.

dataframeName

The name, without quotes, of the dataframe that will be used to create the dataset in Numetric.

category

The category, in quotes, given to the dataset in the Numetric Warehouse.

primaryKey

A vector with the column name(s), in quotes, that will be used as the primary key. Each row should have a unique id, otherwise, the last row indexed will be the one saved.

geoshapes

The column name, or vector of column names, in quotes, that will be stored as a geoShape (point on a map). This needs to be in the format, "lat,long".

geopoints

The column name, or vector of column names, in quotes, that will be stored as a geoPoint (for heatmaps). This needs to be in the format, "lat,long".

boolean

The column name, or vector of column names, in quotes, that will be stored as True/False. True = 1, False = 0.

everyone

Defaults to "false". If set to "true", then it will allow everyone in the org to see the dataset.

Value

Numetric Id


Deletes all rows from a dataset (V2)

Description

Clears out all the rows of a dataset, but preserves the id and url of the dataset (as opposed to the deleteDataset function).

This function uses the V2 version of the API.

Usage

deleteAllRows(apiKey, datasetId)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

datasetId

The dataset ID, in quotes. You can find the dataset ID by either (1) using the getDatasets function, or (2) navigating to the dataset, and then selecting the string after the last forward slash.


Delete all Rows of a Table (V3)

Description

RDeletes all the rows in a table. This function uses the V3 version of the API.

Usage

deleteAllRowsV3(apiKey, tableId)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

tableId

The id of the table. You can find this by using the getTables function, or by navigating to the table, and then selecting the string after the last forward slash of the url.


Deletes a dashboard (V2)

Description

Deletes a dashboard using the API.

This function uses the V2 version of the API.

Usage

deleteDashboard(apiKey, dashboardId)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

dashboardId

The dashboard ID, in quotes. You can find the dashboard ID by either (1) using the getDashboards function, or (2) navigating to the dashboard, and then selecting the string after the last forward slash.


Deletes a dataset (V2)

Description

Deletes a dataset using the API.

This function uses the V2 version of the API.

Usage

deleteDataset(apiKey, datasetId)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

datasetId

The dataset ID, in quotes. You can find the dataset ID by either (1) using the getDatasets function, or (2) navigating to the dataset, and then selecting the string after the last forward slash.


Deletes specific rows from a dataset (V2)

Description

Deletes rows of a dataset based on a vector of primary keys.

This function uses the V2 version of the API.

Usage

deleteSomeRows(apiKey, datasetId, rows)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

datasetId

The dataset ID, in quotes. You can find the dataset ID by either (1) using the getDatasets function, or (2) navigating to the dataset, and then selecting the string after the last forward slash.

rows

A vector of rows containing the primary keys of the rows to be deleted.


Deletes a table (V3)

Description

Deletes a table using the API.

This function uses the V3 version of the API.

Usage

deleteTable(apiKey, tableId)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

tableId

The table ID, in quotes. You can find the table ID by either (1) using the getTables function, or (2) navigating to the table, and then selecting the string after the last forward slash.


Get up to 10,000 rows of a dataset (V2)

Description

Returns a dataframe with up to 10,000 rows of a dataset.

This function uses the V2 version of the API.

Usage

getAllRows(apiKey, datasetId, size = 10000, includes, excludes)

Arguments

apiKey

The API key, in quotes. You can find the API key in the settings after logging into Numetric

datasetId

The dataset Id, in quotes. You can find the dataset Id by using the getDatasets function, or by navigating to the dataset. The string after the last forward slash in the url is the dataset Id.

size

The maximum number of rows of data to return. The default and maximum is 10,000.

includes

Optional. A vector of stings listing the column names that you want to INCLUDE. The default is to include all columns.

excludes

Optional. A vector of stings listing the column names that you want to EXCLUDE. The default is to exclude no columns.

Value

Returns a dataframe.


Get all rows of data from a table (V3)

Description

Returns every single row of a V3 table.

This function uses the V3 version of the API.

Usage

getAllRowsV3(apiKey, datasetId)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

datasetId

The id of the dataset. This can be found by navigating to the dataset in Numetric, and then referring to the string of characters after the last forward slash in the URL.

Value

Numetric Id


Gets the JSON for a Numetric dashboard (V2)

Description

Returns the JSON for a Numetric Dashboard

This function uses the V2 version of the API.

Usage

getDashboard(apiKey, dashboardId)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

dashboardId

The dashboard ID, in quotes. You can find the dashboard ID by either (1) using the getDashboards function, or (2) navigating to the dashboard, and then selecting the string after the last forward slash.


Get a meta-data for all dashboards in an org (V2)

Description

Returns a dataframe with meta-data about all of the dashboards in an org.

This function uses the V2 version of the API.

Usage

getDashboards(apiKey)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

Value

Returns a dataframe.


Get a table of datasets (V2)

Description

Returns a table with meta-data about all the tables. This function uses the V2 version of the API.

Usage

getDatasets(apiKey)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric


Get the status of a dataset (V2)

Description

Find out if the index is complete. This function uses the V2 version of the API.

Usage

getDatasetStatus(apiKey, datasetId)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

datasetId

The dataset ID can be found by using the getDatasets function, or by navigating to the dataset in Numetric, and selecting the string after the last forward slash.

Value

Returns a dataframe.


Get up to 10,000 rows of a filtered dataset (V2)

Description

Returns a dataframe with up to 10,000 rows of a dataset after applying a term or range filter.

This is especially useful when trying to download a dataset from Numetric that has more than 10,000 rows.

This function uses the V2 version of the API.

Usage

getFilteredRows(apiKey, datasetId, filterType = "term", filterField = "",
  filterValue = "", customFilterValue = "", startRange = "",
  endRange = "", size = 10000, includes = "", excludes = "")

Arguments

apiKey

The API key, in quotes. You can find the API key in the settings after logging into Numetric

filterType

The type of filter to apply. Options are "term", "range", "custom", or "none". Default value is "none".

filterField

The name of the column, in quotes, to use as a filter. This should not used when the filterType is "custom".

filterValue

This is only used when applying a term filter. The value in quotes, is what will be included. (If the must argument is set to "false", then this will be an exclude filter.) This should not used when the filterType is "custom".

customFilterValue

This is used in conjunction with a custom filterType. The format should be: "filter": "term", "field": "fieldName", "value": "value"

startRange

If the filterType == range, then this is a minimum numeric value or date, in quotes. If it's a date, then it should be in the format of "2017-05-30T00.00.00.000".

endRange

If the filterType == range, then this is a maximum numeric value or date, in quotes. If it's a date, then it should be in the format of "2017-05-30T00.00.00.000".

size

The maximum number of rows of data to return. The default and maximum is 10,000.

includes

Optional. A vector of stings listing the column names that you want to INCLUDE. The default is to include all columns.

excludes

Optional. A vector of stings listing the column names that you want to EXCLUDE. The default is to exclude no columns.

bucketVar

The name of the dataset column, in quotes, that will be used to bucket the data.

must

Whether the term filter is an include or excludes filter. By default it's set to "true", which is an includes filter. If set to "false", then it will be an excludes term filter.

Value

Returns a dataframe.


Get the details of a specific table (V3)

Description

Returns a one row dataframe with meta data about the table of interest. This function uses the V3 version of the API.

Usage

getTableDetails(apiKey, tableId, fieldNames = T)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

tableId

The id of the table. You can find this by using the getTables function, or by navigating to the table, and then selecting the string after the last forward slash of the url.

fieldNames

By default it returns the display name, order, and type of all the fields. This can make the table very wide. If set to false, this field information will not be returned.


Get a summary list of tables available to the API user (V3)

Description

Returns a table with meta-data about all the tables. This function uses the V3 version of the API.

Usage

getTables(apiKey)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric


Updates an existing Numetric dashboard (V2)

Description

Updates the name, category, and content of an existing Numetric dashboard.

This function uses the V2 version of the API.

Usage

updateDashboard(apiKey, dashboardId, name = "None", category = "None",
  content)

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

dashboardId

The id of the dashboard. This can be found by using the getDashboards function, or by navigating to the dashboard and then selecting the string after the last forward slash.

name

The name of the dashboard, in quotes, in Numetric. Defaults to "None".

category

The category, in quotes, of the dashboard. Defaults to "None".

content

JSON formatted string of text. See https://nrl.readme.io/docs for more information.


Updates the parameters of an existing dataset (V2)

Description

Uupdate an existing dataset in a Numetric Org.

This is useful when you want to add new columns to a dataset. You can also use it change the name or category of a dataset.

This function uses the V2 version of the API.

Usage

updateDataset(apiKey, datasetId, numetricName, dataframeName,
  category = "New Data", autocompletes = "", geoshapes = "",
  geopoints = "", boolean = "")

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

datasetId

The dataset ID, in quotes, to be updated. It can be found by using the getDatasets function, or by navigating to the dataset in Numetric, and selecting the string after the last forward slash.

numetricName

The name, in quotes, given to the dataset in the Numetric Warehouse.

dataframeName

The name, without quotes, of the dataframe that will be used to create the dataset in Numetric.

category

The category, in quotes, given to the dataset in the Numetric Warehouse.

autocompletes

The column name, or vector of column names, in quotes, that will autocomplete in the Numetric quick search bar.

geoshapes

The column name, or vector of column names, in quotes, that will be stored as a geoShape (point on a map). This needs to be in the format, "lat,long".

geopoints

The column name, or vector of column names, in quotes, that will be stored as a geoPoint (for heatmaps). This needs to be in the format, "lat,long".

boolean

The column name, or vector of column names, in quotes, that will be stored as True/False. True = 1, False = 0.

id

The name of the column, in quotes, that will be used as the primary key. Each row should have a unique id, otherwise, the last row indexed will be the one saved.

Value

Returns the status of the update.


Update a specific table (V3)

Description

Updates a table using a dataframe.

This function uses the V3 version of the API.

Usage

updateTable(apiKey, tableId, numetricName, dataframeName,
  category = "New Data", primaryKey, geoshapes = "", geopoints = "",
  boolean = "")

Arguments

apiKey

You can find the API key in the settings after logging into Numetric

tableId

The id, in quotes, of a table in the Data Warehouse.

numetricName

The name, in quotes, given to the dataset in the Numetric Warehouse.

dataframeName

The name, without quotes, of the dataframe that will be used to create the dataset in Numetric.

category

The category, in quotes, given to the dataset in the Numetric Warehouse.

primaryKey

The name of the column, in quotes, that will be used as the primary key. Each row should have a unique id, otherwise, the last row indexed will be the one saved.

geoshapes

The column name, or vector of column names, in quotes, that will be stored as a geoShape (point on a map). This needs to be in the format, "lat,long".

geopoints

The column name, or vector of column names, in quotes, that will be stored as a geoPoint (for heatmaps). This needs to be in the format, "lat,long".

boolean

The column name, or vector of column names, in quotes, that will be stored as True/False. True = 1, False = 0.

Value

Numetric Id