knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
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.
This package is not yet on CRAN. However, you can install it from GitHub:
# install.packages("devtools") install_github("ijlyttle/ieeecomtrade")
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)
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.