Title: | 'FactSet' 'STACH' Extensions Package |
Version: | 1.0.4 |
Description: | Allow clients to convert 'FactSet' 'STACH' formatted data to simpler tabular formats in the form of data frames. This package also provides helper methods to extract the meta data from 'FactSet' 'STACH' formatted data. See documentation on the 'GitHub' repository for more information. |
License: | Apache License 2.0 |
URL: | https://github.com/factset/stach-extensions |
BugReports: | https://github.com/factset/stach-extensions/issues |
Imports: | jsonlite, R6, stringr |
Suggests: | testthat |
SystemRequirements: | ProtoBuf libraries and compiler version 3.3.0 or later; On Debian/Ubuntu these can be installed as libprotoc-dev, libprotobuf-dev and protobuf-compiler, while on Fedora/CentOS protobuf-devel and protobuf-compiler are needed. |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.1 |
NeedsCompilation: | no |
Packaged: | 2023-10-17 15:51:20 UTC; vmupparaju |
Author: | Veda Bhaskara Ramanth [aut, cre] |
Maintainer: | Veda Bhaskara Ramanth <vedabhaskararamanth.addala@factset.com> |
Repository: | CRAN |
Date/Publication: | 2023-10-19 06:20:02 UTC |
V2ColumnOrganizedStachExtension
Description
The purpose of this class is to provide the helper methods for converting stach(column organized) to Tabular format and to get meta data from stach
Methods
Public methods
Method ConvertToDataFrame()
This function is used for converting stach to Tabular format
Usage
V2ColumnOrganizedStachExtension$ConvertToDataFrame(package, mergeHeaders)
Arguments
package
Stach Data which is represented as a Package object
mergeHeaders
Accepts Type as BOOLEAN,by default takes TRUE. If the value is TRUE, headers will be merged with column data as output in dataframe If the value is FALSE, headers will be added to column data as output in dataframe
Returns
Returns the List of data frame for the stach data
Method GetMetadata()
This function is used to get meta data from stach
Usage
V2ColumnOrganizedStachExtension$GetMetadata(package)
Arguments
package
Stach Data which is represented as a Package object
Returns
Returns the List of metadata for the stach data
Method clone()
The objects of this class are cloneable with this method.
Usage
V2ColumnOrganizedStachExtension$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
## Not run:
package <- 'Stach data which is converted into ColumnOrganized Package'
stachExtensioncol <-
factset.protobuf.stachextensions::V2ColumnOrganizedStachExtension$new()
dataFrame <- stachExtensioncol$ConvertToDataFrame(package)
## End(Not run)
V2ColumnOrganizedStachUtilities
Description
Provide helper functions for column organized stach
Methods
Public methods
Method GetPrimaryTableIds()
Get Primary Table Ids
Usage
V2ColumnOrganizedStachUtilities$GetPrimaryTableIds(package)
Arguments
package
Stach Data which is represented as a Package object
Returns
Returns list of primary table ids
Method Decompress()
Get decompress stach data
Usage
V2ColumnOrganizedStachUtilities$Decompress(package)
Arguments
package
Stach Data which is represented as a Package object
Returns
Returns decompressed stach data
Method clone()
The objects of this class are cloneable with this method.
Usage
V2ColumnOrganizedStachUtilities$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
## Not run:
compressedFilePath <- 'Path of your json file'
compressedData <- jsonlite::read_json(path=compressedFilePath,
auto_unbox=TRUE)
stachUtilities <-
factset.protobuf.stachextensions::V2ColumnOrganizedStachUtilities
primaryTableIds <-
stachUtilities$public_methods$GetPrimaryTableIds(compressedData)
## End(Not run)
## Not run:
compressedFilePath <- 'Path of your json file'
compressedData <- jsonlite::read_json(path=compressedFilePath,
auto_unbox=TRUE)
utility <-
factset.protobuf.stachextensions::V2ColumnOrganizedStachUtilities$new()
deCompressedData <- utility$Decompress(compressedData)
## End(Not run)
V2RowOrganizedStachExtension
Description
The purpose of this class is to provide the helper methods for converting stach(row organized) to Tabular format and to get meta data from stach
Methods
Public methods
Method ConvertToDataFrame()
This function is used for converting stach to Tabular format
Usage
V2RowOrganizedStachExtension$ConvertToDataFrame(package, mergeHeaders)
Arguments
package
Stach Data which is represented as a Package object
mergeHeaders
Accepts Type as BOOLEAN,by default takes TRUE. If the value is TRUE, headers will be merged with column data as output in dataframe If the value is FALSE, headers will be added to column data as output in dataframe
Returns
Returns the List of data frame for the stach data
Method GetMetadata()
This function is used to get meta data from stach
Usage
V2RowOrganizedStachExtension$GetMetadata(package)
Arguments
package
Stach Data which is represented as a Package object
Returns
Returns the List of metadata for the stach data
Method clone()
The objects of this class are cloneable with this method.
Usage
V2RowOrganizedStachExtension$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
## Not run:
package <- 'Stach data which is converted into RowOrganized Package'
stachExtensionrow <-
factset.protobuf.stachextensions::V2RowOrganizedStachExtension$new()
dataFrame <- stachExtensionrow$ConvertToDataFrame(package)
## End(Not run)
V2StachUtilities
Description
The purpose of this class is to provide the helper methods
Methods
Public methods
Method GetMappingObject()
Helper method for getting the value corresponding to the given key from the object.
Usage
V2StachUtilities$GetMappingObject(objectMap, key, keyname = "key")
Arguments
objectMap
Mapping object value
key
Mapping object corresponding key value
keyname
Mapping object corresponding key name
Returns
Returns the value corresponding to the given key from the object
Method ValueToString()
Helper method for converting value to string
Usage
V2StachUtilities$ValueToString(value)
Arguments
value
Value that should be converted to string
Returns
Returns the value by converting corresponding value to string
Method clone()
The objects of this class are cloneable with this method.
Usage
V2StachUtilities$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
## Not run:
package <- 'Stach data which is converted into RowOrganized Package'
tableData <-
V2StachUtilities$public_methods$GetMappingObject(package$tables,
primaryTableId)$value
## End(Not run)