| Title: | Interface to 'JDemetra+' 3.x Time Series Analysis Software |
|---|---|
| Description: | Interface to 'JDemetra+' 3.x (<https://github.com/jdemetra>) time series analysis software. It offers full access to txt, csv, xml and spreadsheets files which are meant to be read by 'JDemetra+' Graphical User Interface. |
| Authors: | Jean Palate [aut], Alessandro Piovani [aut, cre], Tanguy Barthelemy [ctb, art] |
| Maintainer: | Alessandro Piovani <[email protected]> |
| License: | EUPL |
| Version: | 3.7.1.9000 |
| Built: | 2026-05-10 08:05:46 UTC |
| Source: | https://github.com/rjdverse/rjd3providers |
Generates the Java object for data formats
.obs_format( locale = NULL, dateFmt = NULL, numberFmt = NULL, ignoreNumberGrouping = TRUE ).obs_format( locale = NULL, dateFmt = NULL, numberFmt = NULL, ignoreNumberGrouping = TRUE )
locale |
Locale language. Null to use the default |
dateFmt |
Format of the date. Null to use the default of the locale |
numberFmt |
Format of the number. Null to use the default of the locale |
ignoreNumberGrouping |
Ignore number grouping |
An internal Java object.
.obs_format(locale = "french-be").obs_format(locale = "french-be")
Generates the Java object for automatic aggregation of the data
.obs_gathering( period = 0, aggregationType = NULL, allowPartialAggregation = FALSE, cleanMissing = TRUE ).obs_gathering( period = 0, aggregationType = NULL, allowPartialAggregation = FALSE, cleanMissing = TRUE )
period |
The annual frequency of the series. If 0, the frequency. |
aggregationType |
The type of the aggregation to be applied on the series (only used if "period" is different from 0). |
allowPartialAggregation |
Specifies if the aggregation is performed or not when they are missing periods. |
cleanMissing |
Specifies if missing values at the beginning and at the end of the data are removed from the series. |
An internal Java object.
.obs_gathering(period=4, aggregationType="Sum").obs_gathering(period=4, aggregationType="Sum")
Generates a java moniker for the corresponding id.
.spreadsheet_moniker(id).spreadsheet_moniker(id)
id |
Identifier of the requested information. |
An internal Java moniker.
.spreadsheet_moniker("toy_id").spreadsheet_moniker("toy_id")
Generates a java moniker for the corresponding id.
.txt_moniker(id).txt_moniker(id)
id |
Identifier of the requested information. |
An internal java moniker.
.txt_moniker("toy_id").txt_moniker("toy_id")
Generates a java moniker for the corresponding id.
.xml_moniker(id).xml_moniker(id)
id |
Identifier of the requested information. |
An internal java moniker.
.xml_moniker("toy_id").xml_moniker("toy_id")
These functions are deprecated and are kept only for backward compatibility. Users should use the corresponding non-deprecated functions instead:
spreadsheet_to_id() spreadsheet_properties_to_id()
spreadsheet_id_properties() spreadsheet_id_to_properties()
txt_to_id() txt_properties_to_id()
txt_id_properties() txt_id_to_properties()
xml_to_id() xml_properties_to_id()
xml_id_properties() xml_id_to_properties()
spreadsheet_to_id(props) spreadsheet_id_properties(id) txt_to_id(props) txt_id_properties(id) xml_to_id(props) xml_id_properties(id)spreadsheet_to_id(props) spreadsheet_id_properties(id) txt_to_id(props) txt_id_properties(id) xml_to_id(props) xml_id_properties(id)
props |
The properties defining the identifier. |
id |
Identifier of a series or of a collection of series. |
The same value as returned by the corresponding non-deprecated function. The returned object represents an encoded identifier for a spreadsheet series or collection.
The same output as spreadsheet_id_to_properties.
It is a list with the elements of the identifier: file, sheet, series, and gathering
(which contains period, aggregation, partialAggregation, and cleanMissing flags).
The same output as txt_properties_to_id(): a string representing the internal identifier.
The same output as txt_id_to_properties(): a list with the elements of the id (file, series, format, gathering, etc.).
Returns the same output as xml_properties_to_id(): an internal identifier corresponding to the XML properties.
Returns the same output as xml_id_to_properties(): a list of the XML identifier’s properties (file, collection[, series], charset, fullNames).
# Deprecated: use spreadsheet_properties_to_id() instead set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) id<-xls_s1_3$moniker$id source<-spreadsheet_name() # props<-spreadsheet_id_properties(xls_s1_3$moniker$id) # DEPRECATED props<-spreadsheet_id_to_properties(xls_s1_3$moniker$id) # RECOMMENDED props$gathering$period<-4 props$gathering$aggregation<-"Max" # M<-rjd3toolkit::to_ts(spreadsheet_name(), # spreadsheet_to_id(props)) M<-rjd3toolkit::to_ts(spreadsheet_name(), # DEPRECATED spreadsheet_properties_to_id(props)) # RECOMMENDED props$gathering$aggregation<-"Min" # m<-rjd3toolkit::to_ts(spreadsheet_name(), # spreadsheet_to_id(props)) # DEPRECATED m<-rjd3toolkit::to_ts(spreadsheet_name(), spreadsheet_properties_to_id(props)) # RECOMMENDED ts.plot(ts.union(M$data,m$data), col=c("red", "blue")) # Deprecated: use spreadsheet_id_to_properties() instead set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) id<-xls_s1_3$moniker$id # print(spreadsheet_id_properties(id)) # DEPRECATED print(spreadsheet_id_to_properties(id)) # RECOMMENDED # Deprecated: use txt_properties_to_id() instead set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id source<-txt_name() # props<-txt_id_properties(id) # DEPRECATED props<-txt_id_to_properties(id) # RECOMMENDED props$gathering$period<-4 props$gathering$aggregation<-"Max" # M<-rjd3toolkit::to_ts(txt_name(), txt_to_id(props)) # DEPRECATED M<-rjd3toolkit::to_ts(txt_name(), txt_properties_to_id(props)) # RECOMMENDED props$gathering$aggregation<-"Min" # m<-rjd3toolkit::to_ts(txt_name(), txt_to_id(props)) # DEPRECATED m<-rjd3toolkit::to_ts(txt_name(), txt_properties_to_id(props)) # RECOMMENDED ts.plot(ts.union(M$data,m$data), col=c("red", "blue")) # Deprecated: use txt_id_to_properties() instead set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id # print(txt_id_properties(id)) # DEPRECATED print(txt_id_to_properties(id)) # RECOMMENDED # Deprecated: use xml_properties_to_id() instead set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") # q <- xml_id_properties(xml_1_5$moniker$id) # DEPRECATED q <- xml_id_to_properties(xml_1_5$moniker$id) # RECOMMENDED q$series <- 50 # xml_to_id(q) # DEPRECATED xml_properties_to_id(q) # RECOMMENDED # Deprecated: use xml_id_to_properties() instead set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") # xml_id_properties(xml_1_5$moniker$id) # DEPRECATED xml_id_to_properties(xml_1_5$moniker$id) # RECOMMENDED xml_1 <- xml_data("Prod.xml", 1, charset = "iso-8859-1") # xml_id_properties(xml_1$moniker$id) # DEPRECATED xml_id_to_properties(xml_1$moniker$id) # RECOMMENDED# Deprecated: use spreadsheet_properties_to_id() instead set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) id<-xls_s1_3$moniker$id source<-spreadsheet_name() # props<-spreadsheet_id_properties(xls_s1_3$moniker$id) # DEPRECATED props<-spreadsheet_id_to_properties(xls_s1_3$moniker$id) # RECOMMENDED props$gathering$period<-4 props$gathering$aggregation<-"Max" # M<-rjd3toolkit::to_ts(spreadsheet_name(), # spreadsheet_to_id(props)) M<-rjd3toolkit::to_ts(spreadsheet_name(), # DEPRECATED spreadsheet_properties_to_id(props)) # RECOMMENDED props$gathering$aggregation<-"Min" # m<-rjd3toolkit::to_ts(spreadsheet_name(), # spreadsheet_to_id(props)) # DEPRECATED m<-rjd3toolkit::to_ts(spreadsheet_name(), spreadsheet_properties_to_id(props)) # RECOMMENDED ts.plot(ts.union(M$data,m$data), col=c("red", "blue")) # Deprecated: use spreadsheet_id_to_properties() instead set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) id<-xls_s1_3$moniker$id # print(spreadsheet_id_properties(id)) # DEPRECATED print(spreadsheet_id_to_properties(id)) # RECOMMENDED # Deprecated: use txt_properties_to_id() instead set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id source<-txt_name() # props<-txt_id_properties(id) # DEPRECATED props<-txt_id_to_properties(id) # RECOMMENDED props$gathering$period<-4 props$gathering$aggregation<-"Max" # M<-rjd3toolkit::to_ts(txt_name(), txt_to_id(props)) # DEPRECATED M<-rjd3toolkit::to_ts(txt_name(), txt_properties_to_id(props)) # RECOMMENDED props$gathering$aggregation<-"Min" # m<-rjd3toolkit::to_ts(txt_name(), txt_to_id(props)) # DEPRECATED m<-rjd3toolkit::to_ts(txt_name(), txt_properties_to_id(props)) # RECOMMENDED ts.plot(ts.union(M$data,m$data), col=c("red", "blue")) # Deprecated: use txt_id_to_properties() instead set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id # print(txt_id_properties(id)) # DEPRECATED print(txt_id_to_properties(id)) # RECOMMENDED # Deprecated: use xml_properties_to_id() instead set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") # q <- xml_id_properties(xml_1_5$moniker$id) # DEPRECATED q <- xml_id_to_properties(xml_1_5$moniker$id) # RECOMMENDED q$series <- 50 # xml_to_id(q) # DEPRECATED xml_properties_to_id(q) # RECOMMENDED # Deprecated: use xml_id_to_properties() instead set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") # xml_id_properties(xml_1_5$moniker$id) # DEPRECATED xml_id_to_properties(xml_1_5$moniker$id) # RECOMMENDED xml_1 <- xml_data("Prod.xml", 1, charset = "iso-8859-1") # xml_id_properties(xml_1$moniker$id) # DEPRECATED xml_id_to_properties(xml_1$moniker$id) # RECOMMENDED
Set the paths to spreadsheet files (to be used with relative identifiers).
set_spreadsheet_paths(paths)set_spreadsheet_paths(paths)
paths |
The folders containing the spreadsheet files Only used in relative addresses. |
No output.
set_spreadsheet_paths(system.file("extdata", package = "rjd3providers"))set_spreadsheet_paths(system.file("extdata", package = "rjd3providers"))
Set the paths to txt files (to be used with relative identifiers)
set_txt_paths(paths)set_txt_paths(paths)
paths |
The folders containing the txt files Only used in relative addresses. |
An internal java moniker
set_txt_paths(system.file("extdata", package = "rjd3providers"))set_txt_paths(system.file("extdata", package = "rjd3providers"))
Set the paths to xml files (to be used with relative identifiers).
set_xml_paths(paths)set_xml_paths(paths)
paths |
The folders containing the xml files. Only used in relative addresses. |
No output.
set_xml_paths(system.file("extdata", package = "rjd3providers"))set_xml_paths(system.file("extdata", package = "rjd3providers"))
Change the file of a spreadsheet moniker.
spreadsheet_change_file(id, nfile, ofile = NULL)spreadsheet_change_file(id, nfile, ofile = NULL)
id |
Identifier of a series or of a collection of series. |
nfile |
New file name. |
ofile |
Old file name. NULL or "" to change any file to the new file. |
Returns the new identifier.
set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_all <- spreadsheet_data("Insee.xlsx", 1) id<-xls_all$moniker$id spreadsheet_change_file(id, "test.xlsx")set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_all <- spreadsheet_data("Insee.xlsx", 1) id<-xls_all$moniker$id spreadsheet_change_file(id, "test.xlsx")
Provides the content of a spreadsheet designed for time series.
spreadsheet_content(file)spreadsheet_content(file)
file |
The considered workbook. |
Provides all the names of the time series contained in the workbook, organized by worksheet; the output is a list of lists of names.
set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) print(spreadsheet_content("Insee.xlsx"))set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) print(spreadsheet_content("Insee.xlsx"))
Retrieves all the time series in a specified sheet from a spreadsheet file.
spreadsheet_data( file, sheet = 1, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, fullNames = FALSE )spreadsheet_data( file, sheet = 1, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, fullNames = FALSE )
file |
The spreadsheet file. |
sheet |
The name or the 1-based position of the sheet containing the requested data. |
gathering.period |
The annual frequency of the transformed series. If 0, the actual frequency is used. |
gathering.aggregation |
The type of the aggregation to be applied on the series (only used if "period" is different from 0). |
gathering.partialAggregation |
Specifies if the aggregation is performed or not when they are missing periods. |
gathering.cleanMissing |
Specifies if missing values at the beginning or at the end of the data are removed from the series. |
fullNames |
Specifies if full names (containing the name of the sheet and the name of the series) are used or not. |
A ts collection with all the series.
set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_all <- spreadsheet_data("Insee.xlsx", 1) txt_all <- spreadsheet_data("Insee.xlsx", "FRANCE Textile")set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_all <- spreadsheet_data("Insee.xlsx", 1) txt_all <- spreadsheet_data("Insee.xlsx", "FRANCE Textile")
Gets the list of the properties corresponding to the identifier of a moniker.
spreadsheet_id_to_properties(id)spreadsheet_id_to_properties(id)
id |
Identifier of a series or of a collection of series. |
When the period in the gathering list is defined, the user must specify the aggregation type ("Sum", "Average", "First", "Last", "Min", "Max") and some additional parameters (partial aggregation and suppression of leading/trailing missing values).
Returns a list with the elements of the id: file, sheet, series, gathering); the gathering is a list with the following items: period (-1 by default), the aggregation ("None"), partialAggregation (FALSE), includeMissing (FALSE).
[spreadsheet_properties_to_id()]
set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) id<-xls_s1_3$moniker$id print(spreadsheet_id_to_properties(id))set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) id<-xls_s1_3$moniker$id print(spreadsheet_id_to_properties(id))
Gets the name of the spreadsheet provider.
spreadsheet_name()spreadsheet_name()
The name of the spreadsheet provider, to be used in monikers.
print(spreadsheet_name())print(spreadsheet_name())
Generates the id corresponding to a list of spreadsheet properties.
spreadsheet_properties_to_id(props)spreadsheet_properties_to_id(props)
props |
The properties defining the identifier. |
The identifier corresponding to the properties.
set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) id<-xls_s1_3$moniker$id source<-spreadsheet_name() props<-spreadsheet_id_to_properties(xls_s1_3$moniker$id) props$gathering$period<-4 props$gathering$aggregation<-"Max" M<-rjd3toolkit::to_ts(spreadsheet_name(), spreadsheet_properties_to_id(props)) props$gathering$aggregation<-"Min" m<-rjd3toolkit::to_ts(spreadsheet_name(), spreadsheet_properties_to_id(props)) ts.plot(ts.union(M$data,m$data), col=c("red", "blue"))set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) id<-xls_s1_3$moniker$id source<-spreadsheet_name() props<-spreadsheet_id_to_properties(xls_s1_3$moniker$id) props$gathering$period<-4 props$gathering$aggregation<-"Max" M<-rjd3toolkit::to_ts(spreadsheet_name(), spreadsheet_properties_to_id(props)) props$gathering$aggregation<-"Min" m<-rjd3toolkit::to_ts(spreadsheet_name(), spreadsheet_properties_to_id(props)) ts.plot(ts.union(M$data,m$data), col=c("red", "blue"))
Retrieves a time series from a spreadsheet file.
spreadsheet_series( file, sheet = 1, series = 1, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, fullName = TRUE )spreadsheet_series( file, sheet = 1, series = 1, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, fullName = TRUE )
file |
The spreadsheet file. |
sheet |
The name or the 1-based position of the sheet containing the requested data. |
series |
The name or the 1-based position of the series in the selected sheet. |
gathering.period |
The annual frequency of the transformed series. If 0, the actual frequency is used. |
gathering.aggregation |
The type of the aggregation to be applied on the series (only used if "period" is different from 0). |
gathering.partialAggregation |
Specifies if the aggregation is performed or not when they are missing periods. |
gathering.cleanMissing |
Specifies if missing values are removed at the beginning or at the end of the data. |
fullName |
Specifies if a full name (containing the name of the sheet and the name of the series) is used or not. |
Returns the specified time series.
set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) txt_s1 <- spreadsheet_series("Insee.xlsx", "FRANCE Textile", 1)set_spreadsheet_paths(system.file("extdata", package = "rjd3providers")) xls_s1_3 <- spreadsheet_series("Insee.xlsx", 1, 3) txt_s1 <- spreadsheet_series("Insee.xlsx", "FRANCE Textile", 1)
Change the file of a text moniker
txt_change_file(id, nfile, ofile = NULL)txt_change_file(id, nfile, ofile = NULL)
id |
Identifier of a series or of a collection of series. |
nfile |
New file name. |
ofile |
Old file name. NULL or "" to change any file to the new file. |
The new identifier
set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id txt_change_file(id, "test.csv")set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id txt_change_file(id, "test.csv")
Provides the content of a text file designed for time series
txt_content( file, fmt.locale = NULL, fmt.date = NULL, fmt.number = NULL, fmt.ignoreNumberGrouping = TRUE, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, charset = NULL, delimiter = c("TAB", "SEMICOLON", "COMMA", "SPACE"), txtQualifier = c("NONE", "QUOTE", "DOUBLE_QUOTE"), header = TRUE, skip = 0 )txt_content( file, fmt.locale = NULL, fmt.date = NULL, fmt.number = NULL, fmt.ignoreNumberGrouping = TRUE, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, charset = NULL, delimiter = c("TAB", "SEMICOLON", "COMMA", "SPACE"), txtQualifier = c("NONE", "QUOTE", "DOUBLE_QUOTE"), header = TRUE, skip = 0 )
file |
The text file |
fmt.locale |
Locale language. Null to use the default |
fmt.date |
Format of the date. Null to use the default of the locale |
fmt.number |
Format of the number. Null to use the default of the locale |
fmt.ignoreNumberGrouping |
Ignore number grouping |
gathering.period |
The annual frequency of the series. If 0, the frequency |
gathering.aggregation |
The type of the aggregation to be applied on the series (only used if "period" is different from 0) |
gathering.partialAggregation |
Specifies if the aggregation is performed or not when they are missing periods |
gathering.cleanMissing |
Specifies if missing values at the beginning or at the end of the data are removed from the series. |
charset |
Specifies the charset |
delimiter |
Specifies the delimiter. Should be in ("TAB", "SEMICOLON", "COMMA", "SPACE") |
txtQualifier |
Character used to qualify text. Should be in ("NONE", "QUOTE", "DOUBLE_QUOTE") |
header |
The file contains headers |
skip |
Skips some lines |
Provides all the names of the time series contained in the text file
set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_all <- txt_content("ABS.csv", delimiter = "COMMA")set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_all <- txt_content("ABS.csv", delimiter = "COMMA")
Retrieves all the time series in a text file (.txt, .csv...)
txt_data( file, fmt.locale = NULL, fmt.date = NULL, fmt.number = NULL, fmt.ignoreNumberGrouping = TRUE, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, charset = NULL, delimiter = c("TAB", "SEMICOLON", "COMMA", "SPACE"), txtQualifier = c("NONE", "QUOTE", "DOUBLE_QUOTE"), header = TRUE, skip = 0 )txt_data( file, fmt.locale = NULL, fmt.date = NULL, fmt.number = NULL, fmt.ignoreNumberGrouping = TRUE, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, charset = NULL, delimiter = c("TAB", "SEMICOLON", "COMMA", "SPACE"), txtQualifier = c("NONE", "QUOTE", "DOUBLE_QUOTE"), header = TRUE, skip = 0 )
file |
The text file |
fmt.locale |
Locale language. Null to use the default |
fmt.date |
Format of the date. Null to use the default of the locale |
fmt.number |
Format of the number. Null to use the default of the locale |
fmt.ignoreNumberGrouping |
Ignore number grouping |
gathering.period |
The annual frequency of the transformed series. If 0, the actual frequency is used. |
gathering.aggregation |
The type of the aggregation to be applied on the series (only used if "period" is different from 0) |
gathering.partialAggregation |
Specifies if the aggregation is performed or not when they are missing periods |
gathering.cleanMissing |
Specifies if missing values at the beginning or at the end of the data are removed from the series. |
charset |
Specifies the charset |
delimiter |
Specifies the delimiter. Should be in ("TAB", "SEMICOLON", "COMMA", "SPACE") |
txtQualifier |
Character used to qualify text. Should be in ("NONE", "QUOTE", "DOUBLE_QUOTE") |
header |
The file contains headers |
skip |
Skips some lines |
A ts collection with all the series
set_txt_paths(system.file("extdata", package = "rjd3providers")) all <- txt_data("ABS.csv", delimiter = "COMMA")set_txt_paths(system.file("extdata", package = "rjd3providers")) all <- txt_data("ABS.csv", delimiter = "COMMA")
Gets the list of the properties corresponding to the identifier of a moniker
txt_id_to_properties(id)txt_id_to_properties(id)
id |
Identifier of a series or of a collection of series. |
Returns a list with the elements of the id: file [, series], format, gathering, ...).
set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id print(txt_id_to_properties(id))set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id print(txt_id_to_properties(id))
Gets the name of the text provider
txt_name()txt_name()
The name of the text provider, to be used in monikers
txt_name()txt_name()
Generates the id corresponding to a list of a text properties.
txt_properties_to_id(props)txt_properties_to_id(props)
props |
The properties defining the identifier. |
The identifier corresponding to the properties.
set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id source<-txt_name() props<-txt_id_to_properties(id) props$gathering$period<-4 props$gathering$aggregation<-"Max" M<-rjd3toolkit::to_ts(txt_name(), txt_properties_to_id(props)) props$gathering$aggregation<-"Min" m<-rjd3toolkit::to_ts(txt_name(), txt_properties_to_id(props)) ts.plot(ts.union(M$data,m$data), col=c("red", "blue"))set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") id<-txt_15$moniker$id source<-txt_name() props<-txt_id_to_properties(id) props$gathering$period<-4 props$gathering$aggregation<-"Max" M<-rjd3toolkit::to_ts(txt_name(), txt_properties_to_id(props)) props$gathering$aggregation<-"Min" m<-rjd3toolkit::to_ts(txt_name(), txt_properties_to_id(props)) ts.plot(ts.union(M$data,m$data), col=c("red", "blue"))
Retrieves a time series from a a text file (.txt, .csv...)
txt_series( file, series, fmt.locale = NULL, fmt.date = NULL, fmt.number = NULL, fmt.ignoreNumberGrouping = TRUE, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, charset = NULL, delimiter = c("TAB", "SEMICOLON", "COMMA", "SPACE"), txtQualifier = c("NONE", "QUOTE", "DOUBLE_QUOTE"), header = TRUE, skip = 0 )txt_series( file, series, fmt.locale = NULL, fmt.date = NULL, fmt.number = NULL, fmt.ignoreNumberGrouping = TRUE, gathering.period = 0, gathering.aggregation = c("None", "Sum", "Average", "First", "Last", "Max", "Min"), gathering.partialAggregation = FALSE, gathering.cleanMissing = TRUE, charset = NULL, delimiter = c("TAB", "SEMICOLON", "COMMA", "SPACE"), txtQualifier = c("NONE", "QUOTE", "DOUBLE_QUOTE"), header = TRUE, skip = 0 )
file |
The text file |
series |
The name or the 1-based position of the series in the selected sheet |
fmt.locale |
Locale language. Null to use the default |
fmt.date |
Format of the date. Null to use the default of the locale |
fmt.number |
Format of the number. Null to use the default of the locale |
fmt.ignoreNumberGrouping |
Ignore number grouping |
gathering.period |
The annual frequency of the transformed series. If 0, the actual frequency is used. |
gathering.aggregation |
The type of the aggregation to be applied on the series (only used if "period" is different from 0) |
gathering.partialAggregation |
Specifies if the aggregation is performed or not when they are missing periods |
gathering.cleanMissing |
Specifies if missing values at the beginning or at the end of the data are removed from the series. |
charset |
Specifies the charset |
delimiter |
Specifies the delimiter. Should be in ("TAB", "SEMICOLON", "COMMA", "SPACE") |
txtQualifier |
Character used to qualify text. Should be in ("NONE", "QUOTE", "DOUBLE_QUOTE") |
header |
The file contains headers |
skip |
Skips some lines |
Returns the specified time series
set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") txt_09 <- txt_series("ABS.csv", series = "0.2.09.10.M", delimiter = "COMMA")set_txt_paths(system.file("extdata", package = "rjd3providers")) txt_15 <- txt_series("ABS.csv", series = 15, delimiter = "COMMA") txt_09 <- txt_series("ABS.csv", series = "0.2.09.10.M", delimiter = "COMMA")
Change the file of an xml moniker.
xml_change_file(id, nfile, ofile = NULL)xml_change_file(id, nfile, ofile = NULL)
id |
Identifier of a series or of a collection of series. |
nfile |
New file name. |
ofile |
Old file name. NULL or "" to change any file to the new file. |
The new identifier.
set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") id<-xml_1_5$moniker$id xml_change_file(id, "test.xml")set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") id<-xml_1_5$moniker$id xml_change_file(id, "test.xml")
Provides the content of an xml file designed for time series.
xml_content(file, charset = NULL)xml_content(file, charset = NULL)
file |
The considered file. |
charset |
The character set used in the file (NULL to use the default). |
Provides all the names of the time series contained in the file, grouped by collection.
set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_content("Prod.xml") print(xml_content)set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_content("Prod.xml") print(xml_content)
Retrieves all the time series in a specified collection from an xml file.
xml_data(file, collection = 1, charset = NULL, fullNames = FALSE)xml_data(file, collection = 1, charset = NULL, fullNames = FALSE)
file |
The xml file. |
collection |
The name or the 1-based position of the collection containing the requested data. |
charset |
The character set used in the file |
fullNames |
Specifies if full names (containing the name of the sheet and the name of the series) are used or not. |
A ts collection with all the series.
set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1 <- xml_data("Prod.xml", 1, charset = "iso-8859-1") xml_all <- xml_data("Prod.xml", "industrial production", charset = "iso-8859-1")set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1 <- xml_data("Prod.xml", 1, charset = "iso-8859-1") xml_all <- xml_data("Prod.xml", "industrial production", charset = "iso-8859-1")
Gets the list of the properties corresponding to the identifier of a moniker.
xml_id_to_properties(id)xml_id_to_properties(id)
id |
Identifier of a series or of a collection of series. |
Returns a list with the elements of the id: file, collection[, series], charset, fullnames.
set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") xml_id_to_properties(xml_1_5$moniker$id) xml_1 <- xml_data("Prod.xml", 1, charset = "iso-8859-1") xml_id_to_properties(xml_1$moniker$id)set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") xml_id_to_properties(xml_1_5$moniker$id) xml_1 <- xml_data("Prod.xml", 1, charset = "iso-8859-1") xml_id_to_properties(xml_1$moniker$id)
Gets the name of the xml provider.
xml_name()xml_name()
The name of the xml provider, to be used in monikers.
xml_name()xml_name()
Generates the id corresponding to a list of an xml properties.
xml_properties_to_id(props)xml_properties_to_id(props)
props |
The properties defining the identifier. |
The identifier corresponding to the properties.
set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") q <- xml_id_to_properties(xml_1_5$moniker$id) q$series <- 50 xml_properties_to_id(q)set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") q <- xml_id_to_properties(xml_1_5$moniker$id) q$series <- 50 xml_properties_to_id(q)
Retrieves a time series from an xml file
xml_series(file, collection = 1, series = 1, charset = NULL, fullName = TRUE)xml_series(file, collection = 1, series = 1, charset = NULL, fullName = TRUE)
file |
The xml file. |
collection |
The name or the 1-based position of the collection containing the requested data. |
series |
The name or the 1-based position of the series in the selected collection. |
charset |
The character set used in the file. |
fullName |
Specifies if a full name (containing the name of the collection and the name of the series) is used or not. |
Returns the specified time series
set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") xml_cn <- xml_series("Prod.xml", "industrial production", "Construction navale", charset = "iso-8859-1")set_xml_paths(system.file("extdata", package = "rjd3providers")) xml_1_5 <- xml_series("Prod.xml", 1, 5, charset = "iso-8859-1") xml_cn <- xml_series("Prod.xml", "industrial production", "Construction navale", charset = "iso-8859-1")