knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

ieeecomtrade

This is a package to help you work with IEEE COMTRADE files. Currently, this package is restricted to:

In time, it is hoped to lift these restrictions, particularly as the need may present itself.

Installation

This package is not yet on CRAN. However, you can install it from GitHub:

# install.packages("devtools")
install_github("ijlyttle/ieeecomtrade")

Usage

The central object in this package is a comtrade object. You can build a comtrade object by reading in the configuration and data files, or you can read a zip file that contains exactly one configuration file and exactly one data file.

Let's look at reading in some sample files provided with this package. As a first example, let's build a comtrade object by reading the configuration file and data file individually.

library("ieeecomtrade")

config <- 
  ct_example("keating_1999.CFG") %>%  # returns a file path
  ct_read_config()                    # returns a configuration object

data <- 
  ct_example("keating_1999.DAT") %>%
  ct_read_data_config(config)

keating <- comtrade(config = config, data = data)  

Similarly, you can read from a zip file

keating <- 
  ct_example("keating_1999.zip") %>%
  ct_read_zip()

If you want a data frame with scaled values and a timestamp:

ct_instant(keating)

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.



ijlyttle/ieeecomtrade documentation built on May 18, 2019, 3:41 a.m.