previewData: Previewing a data structure and its variables which a user...

View source: R/previewData.R

previewDataR Documentation

Previewing a data structure and its variables which a user requests

Description

This function retruns the 100 observations of a particular data table. The option of storing an API key in an environment variable is prepared to run the function without passing an API key every time. Please see the examples bellow.

Usage

previewData(table_name = "", utd_api_key = NULL)

Arguments

table_name

A name of a data table a user specifies. Your input is NOT case-sensitive.

utd_api_key

An API key provided by a server manager at UTD

Value

A data frame of a specified data table.

Note

The retrived data are invoked in a spreadsheet-style by 'View()', but the class of the variable, '_id', in the data is a datafame, so it returns error if you view them by 'edit()'. To check the data with 'edit()', the variable of '_id' needs to be dropped.

Examples

## Not run:  data <- previewData(utd_api_key, "icews")
View(data) # the 100 observations of ICEWS data are shown
# using the option of storing an API key as an environmental variable
Sys.setenv(UTDAPIKEY = "your utd_api_key")
data <- previewData("icews") 
## End(Not run)

KateHyoung/UTDEventData documentation built on Nov. 16, 2022, 2:29 p.m.