* using log directory 'd:/RCompile/CRANincoming/R-devel/DatastreamR.Rcheck' * using R Under development (unstable) (2024-03-14 r86117 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 13.2.0 GNU Fortran (GCC) 13.2.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'DatastreamR/DESCRIPTION' ... OK * this is package 'DatastreamR' version '2.0.4' * package encoding: UTF-8 * checking CRAN incoming feasibility ... NOTE Maintainer: 'LSEG Datastream ' New submission Possibly misspelled words in DESCRIPTION: Datastream (2:22, 10:38, 10:65) The Title field should be in title case. Current version is: 'R package for Datastream Web Services API' In title case that is: 'R Package for Datastream Web Services API' * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking serialization versions ... OK * checking whether package 'DatastreamR' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking for future file timestamps ... OK * checking DESCRIPTION meta-information ... NOTE Authors@R field gives persons with invalid ORCID identifiers: LSEG Datastream [aut, cre] (datastreamapi@lseg.com) * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... WARNING checkRd: (7) TimeSeriesClient.Rd:7-28: Tag \dontrun is only valid in \examples checkRd: (7) TimeSeriesClient.Rd:31-78: Tag \dontrun is only valid in \examples checkRd: (7) TimeSeriesClient.Rd:80-135: Tag \dontrun is only valid in \examples checkRd: (7) TimeSeriesClient.Rd:137-164: Tag \dontrun is only valid in \examples checkRd: (7) TimeSeriesClient.Rd:166-191: Tag \dontrun is only valid in \examples checkRd: (7) TimeSeriesClient.Rd:193-207: Tag \dontrun is only valid in \examples checkRd: (7) TimeSeriesClient.Rd:209-233: Tag \dontrun is only valid in \examples * checking Rd metadata ... OK * checking Rd line widths ... NOTE Rd file 'TimeSeriesClient.Rd': \usage lines wider than 90 characters: # Creating a TimeSeriesClient instance with your credentials automatically logs on for you. # Your Datastream Id might not be permissioned for managing user created items on this API # Creating a TimeSeriesClient instance with your credentials automatically logs on for you # DSUserObjectGetAllResponse has a ResponseStatus property that indicates success or failure # Your Datastream Id might not be permissioned for managing user created items on this API names(DSUserObjectResponseStatus)[itemsResp$ResponseStatus+1], colnames = ('Id', 'LastModified', 'StartDate', 'EndDate', 'Frequency', 'NoOfValues', 'Desc') ifelse(!is.null(tsItem$DateInfo),as.character(tsItem$DateInfo$StartDate),NULL), ifelse(!is.null(tsItem$DateInfo),as.character(tsItem$DateInfo$EndDate),NULL), ifelse(!is.null(tsItem$DateInfo), tsItem$DateInfo$Frequency, NULL), ifelse(!is.null(tsItem$DateRange), tsItem$DateRange$ValuesCount , 0), #Creating a TimeSeriesClient instance with your credentials automatically logs on for you. # You may want to put the timeseries request response handling into a common function. # Any request dealing with a single user created item returns a DSUserObjectResponse. if (tsResponse$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess) names(DSUserObjectResponseStatus)[tsResponse$ResponseStatus+1], # The timeseries item won't be returned if you set SkipItem true in CreateItem or UpdateItem StartDate = ifelse (!is.null(tsItem$DateInfo), as.character(tsItem$DateInfo$StartDate), NULL), EndDate = ifelse(!is.null(tsItem$DateInfo),as.character(tsItem$DateInfo$EndDate), NULL), Frequency = ifelse(!is.null(tsItem$DateInfo), names(DSUserObjectFrequency)[tsItem$DateInfo$Frequency + 1 ... [TRUNCATED] NoOfValues = ifelse(!is.null(tsItem$DateRange), tsItem$DateRange$ValuesCount , 0)) # convertind list to vector either by using as.vector or sapply, # the NULL values in the list are deleted. and thus there will # be mismatch in no of rows and cannot be put in a dataframe # create your timeseries request object. You would normally use the list of supported dates from # First method is to use the optional parameters in the constructor to supply the key data testTs = DSTimeSeriesRequestObject$new('TSZZZ001', startDate, endDate, DSUserObjectFrequency$Quarterly, # first logon with your credentials. Creating a TimeSeriesClient instance with your # create your timeseries request object. You would normally use the list of supported dates # First method is to use the optional parameters in the constructor to supply the key data # first logon with your credentials. Creating a TimeseriesClient instance with your credentials print(paste('Timeseries DeleteItem failed on ', delResp$UserObjectId ', 'with error ', names(DSUserObjectResponseStatus)[d ... [TRUNCATED] print(paste('Timeseries ', delResp$UserObjectId, 'successfully deleted.', '\n\n')) # first logon with your credentials. Creating a TimeseriesClient instance with your credentials if (dateRangeResp$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess) print(paste('GetTimeseriesDateRange failed with error ', names(DSUserObjectResponseStatus)[dateRangeResp$ResponseStatus ... [TRUNCATED] These lines will be truncated in the PDF manual. * checking Rd cross-references ... OK * checking for missing documentation entries ... WARNING Undocumented code objects: 'DSTimeSeriesCarryIndicator' 'DSTimeSeriesDataInput' 'DSTimeSeriesDateAlignment' 'DSTimeSeriesDateInfo' 'DSTimeSeriesDateRange' 'DSTimeSeriesDateRangeResponse' 'DSTimeSeriesFrequencyConversion' 'DSTimeSeriesRequestObject' 'DSTimeSeriesResponseObject' 'DSTimeSeriesUserObjectBase' 'DSUserObjectAccessRights' 'DSUserObjectBase' 'DSUserObjectFrequency' 'DSUserObjectGetAllResponse' 'DSUserObjectResponse' 'DSUserObjectResponseStatus' 'DSUserObjectShareTypes' 'DataClient' All user-level objects in a package should have documentation entries. See chapter 'Writing R documentation files' in the 'Writing R Extensions' manual. * checking for code/documentation mismatches ... WARNING Functions or methods with usage in Rd file 'TimeSeriesClient.Rd' but not in code: 'print' 'if' 'set.seed' Functions or methods with usage in Rd file 'hello.Rd' but not in code: 'hello' * checking Rd \usage sections ... WARNING Undocumented arguments in Rd file 'TimeSeriesClient.Rd' 'paste("GetAllItems failed with error ", names(DSUserObjectResponseStatus)[[itemsResp$ResponseStatus + 1]], ": ", itemsResp$ErrorMessage)' 'paste("GetAllItems failed with error", names(DSUserObjectResponseStatus)[itemsResp$ResponseStatus + 1], ":", itemsResp$ErrorMessage)' 'GetAllItems returned zero timeseries items.' 'df' 'end' 'tsResponse$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess' '{ print(paste("Request failed for timeseries", tsName, "with error", names(DSUserObjectResponseStatus)[tsResponse$ResponseStatus + 1], ":" + tsResponse$ErrorMessage, "\n\n")) }' 'Timeseries item details not returned.' '7' '5' 'paste("Timeseries ", delResp$UserObjectId, "successfully deleted.", "\n\n")' 'dateRangeResp$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess' 'print(paste("GetTimeseriesDateRange failed with error ", names(DSUserObjectResponseStatus)[dateRangeResp$ResponseStatus + 1], dateRangeResp$ErrorMessage))' Objects in \usage without \alias in Rd file 'TimeSeriesClient.Rd': 'print' 'if' 'set.seed' Assignments in \usage in Rd file 'TimeSeriesClient.Rd': timeseriesClient = TimeSeriesClient(NULL, "YourID", "YourPwd") itemsResp = timeseriesClient$GetAllItems() timeseriesClient = TimeSeriesClient$new(NULL, "YourID", "YourPwd") itemsResp = timeseriesClient$GetAllItems() df = data.frame() df = rbind(df, rowdata) colnames(df) = colnames timeseriesClient = TimeSeriesClient$new(NULL, "YourID", "YourPwd") tsName = "TSZZZ001" tsResponse = timeseriesClient$GetItem(tsName) tsItem = tsResponse$UserObject metadata = c(Id = tsItem$Id, Desc = tsItem$Description, LastModified = as.character(tsItem$LastModified), StartDate = ifelse(!is.null(tsItem$DateInfo), as.character(tsItem$DateInfo$StartDate), NULL), EndDate = ifelse(!is.null(tsItem$DateInfo), as.character(tsItem$DateInfo$EndDate), NULL), Frequency = ifelse(!is.null(tsItem$DateInfo), names(DSUserObjectFrequency)[tsItem$DateInfo$Frequency + 1], NULL), NoOfValues = ifelse(!is.null(tsItem$DateRange), tsItem$DateRange$ValuesCount, 0)) df = data.frame(metadata) df = data.frame(Dates = sapply(tsItem$DateRange$Dates, FUN = function(x) { return(as.character(x)) }), Values = sapply(tsItem$DateRange$Values, FUN = function(x) { ifelse(is.null(x), return(NA_character_), return(x)) })) timeseriesClient = TimeSeriesClient$new(NULL, "YourID", "YourPwd") startDate = date(2016, 1, 1) endDate = date.fromisoformat("2022-04-01") freq = DSUserObjectFrequency$Quarterly datesCount = 26 values = rnorm(datesCount) testTs = DSTimeSeriesRequestObject$new("TSZZZ001", startDate, endDate, DSUserObjectFrequency$Quarterly, values) tsResp = timeseriesClient$CreateItem(testTs) timeseriesClient = TimeSeriesClient$new(NULL, "YourID", "YourPwd") startDate = as.Date("2016-01-01") endDate = as.Date("2016-02-06") freq = DSUserObjectFrequency$Quarterly datesCount = 26 values = rnorm(datesCount) tsResp = timeseriesClient$UpdateItem(testTs) timeseriesClient = TimeseriesClien$newt(NULL, "YourID", "YourPwd") delResp = timeseriesClient$DeleteItem("TSZZZ001") timeseriesClient = TimeSeriesClient$new(NULL, "YourID", "YourPwd") startDate = as.Date("2016-01-01") endDate = as.Date("2022-04-01") freq = DSUserObjectFrequency$Quarterly dateRangeResp = timeseriesClient$GetTimeseriesDateRange(startDate, endDate, freq) df = data.frame(unlist(as.character(dateRangeResp$Dates))) Bad \usage lines found in Rd file 'TimeSeriesClient.Rd': dontrun{ if (!is.null(itemsResp)) { if (itemsResp$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess) { } else if (!is.null(itemsResp$UserObjects) & itemsResp$UserObjectsCount > 0) } } : dontrun{ if (!is.null(itemsResp)) { if (itemsResp$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess) { } else if (itemsResp$UserObjectsCount == 0 | itemsResp$UserObjects == NULL) else { print(paste('GetAllItems returned', itemsResp$UserObjectsCount, 'timeseries items.') colnames = ('Id', 'LastModified', 'StartDate', 'EndDate', 'Frequency', 'NoOfValues', 'Desc') for (tsItem in itemsResp$UserObjects) { if (!is.null(tsItem)) { rowdata = (tsItem$Id, tsItem$Description, tsItem$LastModified, ifelse(!is.null(tsItem$DateInfo),as.character(tsItem$DateInfo$StartDate),NULL), ifelse(!is.null(tsItem$DateInfo),as.character(tsItem$DateInfo$EndDate),NULL), ifelse(!is.null(tsItem$DateInfo), tsItem$DateInfo$Frequency, NULL), ifelse(!is.null(tsItem$DateRange), tsItem$DateRange$ValuesCount , 0), tsItem$Description) } } } } } dontrun{ if (!is.null(tsResponse)) { else if (!is.null(tsResponse$UserObject)) { if (!is.null(tsItem$DateRange)) { } } } else } dontrun{ } dontrun{ testTs = DSTimeSeriesRequestObject$new('TSZZZ001', startDate, endDate, } dontrun{ if (!is.null(delResp)) { if (delResp$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess) print(paste('Timeseries DeleteItem failed on ', delResp$UserObjectId ', 'with error ', names(DSUserObjectResponseStatus)[delResp$ResponseStatus + 1], ': ', delResp.ErrorMessage, '\n\n')) else } } dontrun{ if (!is.null(dateRangeResp)) { else if (!is.null(dateRangeResp$Dates)) { } } } Functions with \usage entries need to have the appropriate \alias entries, and all their arguments documented. The \usage entries must correspond to syntactically valid R code. See chapter 'Writing R documentation files' in the 'Writing R Extensions' manual. * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking LazyData ... NOTE 'LazyData' is specified without a 'data' directory * checking examples ... ERROR Running examples in 'DatastreamR-Ex.R' failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: hello > ### Title: Hello, World! > ### Aliases: hello > > ### ** Examples > > hello() Error in hello() : could not find function "hello" Execution halted * checking for unstated dependencies in 'tests' ... OK * checking tests ... [11s] ERROR Running 'Test_GetData.R' Running 'Test_UCTS.R' Running 'test_GetDataBundle.R' Running 'test_GetData_EconCC.R' Running 'test_GetData_Expressions.R' Running 'test_GetData_Lists.R' Running 'test_GetData_RespClass.R' Running 'test_GetData_SymbolSub.R' Running 'test_GetData_plot.R' Running 'test_UCTS_CreateItem.R' Running 'test_UCTS_DeleteItem.R' Running 'test_UCTS_GetAllItems.R' Running 'test_UCTS_GetItem.R' Running 'test_UCTS_UpdateItem.R' Running 'testthat.R' Running the tests in 'tests/Test_GetData.R' failed. Complete output: > library(DatastreamR) > #logger::log_threshold(level=loglevel('ERROR')) > > # Login using Wrong Username or Password > ds = DataClient$new(NULL, "YourId", "YourPwd") INFO [2024-03-14 15:45:51] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:51] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:51] DSConnect.R DSConnect$getToken No response received > > # Login using Configuration > # ds = DataClient("Config.ini") > > # Example 1: To retrieve data for tickers VOD and BARC for dattypes PH and PL > # with start and end date as given. The retrived data is captured in a > # dataframe and further the values are displayed in a Chart. > # > > df = tryCatch ({ + print("Retrieving data into dataframe and plot the values") + ds$getDataframe(tickers = "VOD,BARC", fields= list("PH", "PL"), start ='2022-01-12',end = '2022-07-13', kind = 1) + }, + error = function(e) { stop (message(e))}) [1] "Retrieving data into dataframe and plot the values" INFO [2024-03-14 15:45:51] Datastream.R DataClient$getDataframe Getting Data INFO [2024-03-14 15:45:51] Datastream.R DataClient$getData Getting Data You are not logged on. Please recreate the client supplying valid user credentials.Error in value[[3L]](cond) : Calls: tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/Test_UCTS.R' failed. Complete output: > # Datastream User Created Timeseries > # ---------------------------------- > # > # Datastream permits users to create and manage custom items. One of these > # types is custom timeseries data. Clients can upload their own timeseries > # data to Datastream’s central systems. These can then be used in combination > # with Datastream maintained series in charts and data requests with the full > # power of the Datastream expressions language. > # > # DatastreamUserCreated_TimeSeries.R defines a TimeseriesClient class and > # ancillary classes that assist in creating and managing timeseries data. > # > # This simple test script demonstrates how to manage custom timeseries data > # using the DatastreamUserCreated_TimeSeries.R module. > # > # Prerequesites: > # > # Firstly, your Datastream credentials need to be permissioned to use the > # Datastream API services. To verify you have access, please access the API > # test page at https://product.datastream.com/dswsclient/Docs/TestUserCreatedItems.aspx. > # Selecting the "Get Token" service method, insert your Datastream credentials > # and press the Execute button. If your credentials are valid and are permissioned > # to access the API service, you will receive a token response. If you are not > # permissioned, you will receive below message > # "User 'Your ID' not entitled to ClientApi service.". > # Please contact your LSEG representative to get your ID permissioned. > # > # Once you have permissions to access the API service, you also need to be > # permissioned to specifically access the service that permits you to access > # and manage custom user created items such as timeseries. You can verify this > # by using the "Get All Items" service method on the above test page. Using the > # token returned from the GetToken method, copy the token into the Token field > # and then select Execute. If you are permissioned for the user created items > # service, you will get a response listing the timeseries available to you on > # Datastream. This may be an empty list if you are a new customer or have never created user created items before. If you > # are not permissioned, you will receive an error message: > # "ID 'Your ID' is not permissioned for user created items.". > # Please contact your LSEG representative to get your ID permissioned. > # > > library (DatastreamR) > library(logger) > > # You can set the threshold for log messages as given below > # logger::log_threshold(ERROR) > > # This is a simple support function for displaying the contents of an individual > # timeseries item. It's used frequently in the demos below. > ProcessTimeseriesResponse = function(tsResponse, tsName) + { + if (!is.null(tsResponse)) + { + # Any request dealing with a single user created item returns a DSUserObjectResponse. This has ResponseStatus property that indicates success or failure + if (tsResponse$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess) + print(paste('Request failed for timeseries', tsName, 'with error ', names(DSUserObjectResponseStatus)[tsResponse$ResponseStatus + 1], ': ', tsResponse$ErrorMessage)) + else if (!is.null(tsResponse$UserObject)) # The timeseries item won't be returned if you set SkipItem true in CreateItem or UpdateItem + { + # Here we simply display the timeseries data using a dataframe. + tsItem = tsResponse$UserObject + metadata = c (Id = tsItem$Id, + Desc = tsItem$Description, + LastModified = as.character(tsItem$LastModified), + StartDate = ifelse (!is.null(tsItem$DateInfo), as.character(tsItem$DateInfo$StartDate), NULL), + EndDate = ifelse(!is.null(tsItem$DateInfo),as.character(tsItem$DateInfo$EndDate), NULL), + Frequency = ifelse(!is.null(tsItem$DateInfo), names(DSUserObjectFrequency)[tsItem$DateInfo$Frequency + 1], NULL), + NoOfValues = ifelse(!is.null(tsItem$DateRange), tsItem$DateRange$ValuesCount , 0)) + df = data.frame(metadata) + print(df) + + if (!is.null(tsItem$DateRange)) + { + df = data.frame(Dates = sapply(tsItem$DateRange$Dates, FUN = function(x) { return (as.character(x)) }), + Values = sapply(tsItem$DateRange$Values, FUN = function(x) { ifelse (is.null(x), return (NA_character_ ), return (x) )} )) + # Values if NULL, is printed as because, while converting list to vector + # either by using as.vector or sapply, the NULL values in the list are deleted. + # and thus there will be mismatch in no of rows and cannot be put in a dataframe + print(df) + } + } + } + else + print(paste('Timeseries ', tsName, ' successfully updated but item details not returned.')) + } > > > # > # To query and modify timeseries, you first need to create a TimeseriesClient > # object using your Datastream credentials. > # > # This can be done in two ways. The first method is simply to create the > # client passing your Datastream credentials in directly: > # > # timeseriesClient = TimeseriesClient(NULL, 'YourID', 'YourPwd') > # > # Alternatively, you can use a configuration file containing your > # credentials. The config file just needs your credentials in the following > # format: > # > # [credentials] > # username=YourID > # password=YourPwd > # > # Then create the TimeseriesClient object passing in the config file. > # > # timeseriesClient = TimeseriesClient('config.ini') > # > # > # Okay, let's start the demo by creating the TimeseriesClient. > > timeseriesClient = NULL > > # Assuming you have permissioned credentials, replace 'YourID' and 'YourPwd' > # with them and then let's logon and create the TimeseriesClient object. > # Note the basic error handling for DSUserObjectFault exceptions > > tryCatch({ + # First step is creating the client by replacing 'YourID' and + # 'YourPwd' with your own credentials. + print('Creating a TimeseriesClient object using your credentials.') + + timeseriesClient = TimeSeriesClient$new(NULL, "zdsm043", "horse485") + + #timeseriesClient = TimeSeriesClient('Config.ini') + + }, + error = function(e) + { + stop(message(e)) + } + ) [1] "Creating a TimeseriesClient object using your credentials." INFO [2024-03-14 15:45:52] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"Error in value[[3L]](cond) : Calls: tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/test_GetDataBundle.R' failed. Complete output: > library(DatastreamR) > > # Login using Configuration > ds = DataClient$new("Config.ini") INFO [2024-03-14 15:45:52] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:52] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:52] DSConnect.R DSConnect$getToken No response received > > dataReq1 = ds$formatDataRequest("VOD",fields= list("PH", "PL"), start ='2022-12-01', + end = '2022-12-05', kind = 1) > dataReq2 = ds$formatDataRequest("BARC",fields= list("PH", "PL"), start ='2022-12-01', + end = '2022-12-05', kind = 1) > dataBundleResp = ds$getDataBundle(list(dataReq1, dataReq2)) INFO [2024-03-14 15:45:52] Datastream.R DataClient$getDataBundle Getting Data Bundle Error in super$CheckToken() : You are not logged on. Please recreate the client supplying valid user credentials. Calls: -> Execution halted Running the tests in 'tests/test_GetData_EconCC.R' failed. Complete output: > library(DatastreamR) > > # Login using Configuration > ds = DataClient$new("Config.ini") INFO [2024-03-14 15:45:53] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:53] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:53] DSConnect.R DSConnect$getToken No response received > > df = tryCatch ({ + ds$getDataframe('ECON', list('DS.ECONCC(startdate=2023-06-07)'), kind=0) + }, + error = function(e){ + stop (message(e)) + } + ) INFO [2024-03-14 15:45:53] Datastream.R DataClient$getDataframe Getting Data INFO [2024-03-14 15:45:53] Datastream.R DataClient$getData Getting Data You are not logged on. Please recreate the client supplying valid user credentials.Error in value[[3L]](cond) : Calls: tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/test_GetData_Expressions.R' failed. Complete output: > library(DatastreamR) > > # Login using Configuration > ds = DataClient$new("Config.ini") INFO [2024-03-14 15:45:54] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:54] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:54] DSConnect.R DSConnect$getToken No response received > > df = tryCatch ({ + ds$getDataframe('MAV#(IN:CYD,20D)|E', NULL, kind=1) + }, + error = function(e) + { + stop (message(e)) + } + ) INFO [2024-03-14 15:45:54] Datastream.R DataClient$getDataframe Getting Data INFO [2024-03-14 15:45:54] Datastream.R DataClient$getData Getting Data You are not logged on. Please recreate the client supplying valid user credentials.Error in value[[3L]](cond) : Calls: tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/test_GetData_Lists.R' failed. Complete output: > library(DatastreamR) > > # Login using Configuration > ds = DataClient$new("Config.ini") INFO [2024-03-14 15:45:55] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:55] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:55] DSConnect.R DSConnect$getToken No response received > > # Long Lists > df = tryCatch ({ + ds$getDataframe('LS&PCOMP', list('NAME', 'ISIN'), kind=0) + }, + error = function(e) { + stop (message(e)) + } + ) INFO [2024-03-14 15:45:55] Datastream.R DataClient$getDataframe Getting Data INFO [2024-03-14 15:45:55] Datastream.R DataClient$getData Getting Data You are not logged on. Please recreate the client supplying valid user credentials.Error in value[[3L]](cond) : Calls: tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/test_GetData_RespClass.R' failed. Complete output: > library(DatastreamR) > > # Login using Configuration > ds = DataClient$new("Config.ini") INFO [2024-03-14 15:45:55] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:55] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:55] DSConnect.R DSConnect$getToken No response received > > # GET DATA into a Response Class > > # Note that dataToDF is FALSE here > dataResp = tryCatch ({ + ds$getData(tickers = "VOD,BARC", fields= list("PH", "PL"), start ='2022-07-12', + end = '2022-07-13', kind = 1) + }, + error = function(e){ + stop (message(e)) + } + ) INFO [2024-03-14 15:45:55] Datastream.R DataClient$getData Getting Data You are not logged on. Please recreate the client supplying valid user credentials.Error in value[[3L]](cond) : Calls: tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/test_GetData_SymbolSub.R' failed. Complete output: > library(DatastreamR) > > # Login using Configuration > ds = DataClient$new("Config.ini") INFO [2024-03-14 15:45:56] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:56] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:56] DSConnect.R DSConnect$getToken No response received > > df = tryCatch ({ + ds$getDataframe('507175', + list ('DCRE', 'UP', 'UPO', 'PHP', 'PLP', + 'DPL#(X(VP),3)', 'DPL#(X(MV),5)', + 'DPL#(X(MTBV),5)', 'DPL#(X(DY),5)', + 'DPL#(X(PC),5)', 'DPL#(X(MSGSFE),5)'), + kind=0) + }, + error = function(e) + { + stop (message(e)) + }) INFO [2024-03-14 15:45:56] Datastream.R DataClient$getDataframe Getting Data INFO [2024-03-14 15:45:56] Datastream.R DataClient$getData Getting Data You are not logged on. Please recreate the client supplying valid user credentials.Error in value[[3L]](cond) : Calls: tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/test_GetData_plot.R' failed. Complete output: > library(DatastreamR) > > # Login using Configuration > ds = DataClient$new("Config.ini") INFO [2024-03-14 15:45:57] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:57] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:57] DSConnect.R DSConnect$getToken No response received > > # GET DATA in Dataframe and plot the values > > # Dataframe is returned > df = tryCatch ({ + ds$getDataframe(tickers = "VOD,BARC", + fields= list("PH","PL"), + start ='2022-01-12', end = '2022-07-13') + }, + error = function(e) + { + stop (message(e)) + + } + ) INFO [2024-03-14 15:45:57] Datastream.R DataClient$getDataframe Getting Data INFO [2024-03-14 15:45:57] Datastream.R DataClient$getData Getting Data You are not logged on. Please recreate the client supplying valid user credentials.Error in value[[3L]](cond) : Calls: tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/test_UCTS_CreateItem.R' failed. Complete output: > library(DatastreamR) > > ProcessTimeseriesResponse = function(tsResponse, tsName) + { + if (!is.null(tsResponse)) + { + # Any request dealing with a single user created item returns a + # DSUserObjectResponse. This has ResponseStatus property that indicates + # success or failure + if (tsResponse$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess) + print(paste('Request failed for timeseries', tsName, 'with error ', names(DSUserObjectResponseStatus)[tsResponse$ResponseStatus + 1], ': ', tsResponse$ErrorMessage, '\n\n')) + else if (!is.null(tsResponse$UserObject)) # The timeseries item won't be returned if you set SkipItem true in CreateItem or UpdateItem + { + # Here we simply display the timeseries data using a dataframe. + tsItem = tsResponse$UserObject + metadata = c (Id = tsItem$Id, + Desc = tsItem$Description, + LastModified = as.character(tsItem$LastModified), + StartDate = ifelse (!is.null(tsItem$DateInfo), as.character(tsItem$DateInfo$StartDate), NULL), + EndDate = ifelse(!is.null(tsItem$DateInfo),as.character(tsItem$DateInfo$EndDate), NULL), + Frequency = ifelse(!is.null(tsItem$DateInfo), names(DSUserObjectFrequency)[tsItem$DateInfo$Frequency + 1], NULL), + NoOfValues = ifelse(!is.null(tsItem$DateRange), tsItem$DateRange$ValuesCount , 0)) + df = data.frame(metadata) + print(df) + + if (!is.null(tsItem$DateRange)) + { + df = data.frame(Dates = sapply(tsItem$DateRange$Dates, + FUN = function(x) + { return (as.character(x)) }), + Values = sapply(tsItem$DateRange$Values, + FUN = function(x) + { ifelse (is.null(x), return (NA_character_ ), return (x) )} )) + # Values if NULL, is printed as because, while + # convertind list to vector either by using as.vector or sapply, + # the NULL values in the list are deleted. and thus there will + # be mismatch in no of rows and cannot be put in a dataframe + print(df) + } + } + } + else + print(paste('Timeseries ', tsName, ' successfully updated but item details not returned.')) + } > > # we need to know which dates are supported on Datastream. > # Datastream only stores the actual working weekdays for a given date range, > # so, we need to provide values that match the dates supported. > > # GetTimeseriesDateRange method which returns a list of supported dates > # for a given start date, end date and frequency. > > timeseriesClient = TimeSeriesClient$new("Config.ini") INFO [2024-03-14 15:45:57] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:57] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:57] DSConnect.R DSConnect$getToken No response received > # Retrieving the supported dates. > # This example intentionally shows two different date constructors, > # requesting quarterly dates between 2016 and 2022. > startDate = as.Date.character('2016-1-1', format = "%Y-%m-%d") > endDate = as.Date('2022-04-01') > freq = DSUserObjectFrequency$Quarterly > print('Requesting GetTimeseriesDateRange to get supported dates from + 2016-01-0 to 2022-04-01 at quarterly frequency.') [1] "Requesting GetTimeseriesDateRange to get supported dates from\n 2016-01-0 to 2022-04-01 at quarterly frequency." > dateRangeResp = timeseriesClient$GetTimeseriesDateRange(startDate, + endDate, freq) INFO [2024-03-14 15:45:57] DatastreamUserCreated_TimeSeries.RTimeSeriesClient$GetTimeseriesDateRangeRequesting date range You are not logged on. Please recreate the client supplying valid user credentials.ERROR [2024-03-14 15:45:57] DatastreamUserCreated_TimeSeries.R TimeSeriesClient$GetTimeseriesDateRange Exception occured. You are not logged on. Please recreate the client supplying valid user credentials.Error in value[[3L]](cond) : Calls: ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/test_UCTS_DeleteItem.R' failed. Complete output: > library(DatastreamR) > > # Login using Configuration > timeseriesClient = TimeSeriesClient$new('Config.ini') INFO [2024-03-14 15:45:58] DSConnect.R DSConnect$getToken :Getting Token and Token Expiry could not find function "content_type_json"ERROR [2024-03-14 15:45:58] DSConnect.R DSConnect$getToken could not find function "content_type_json"ERROR [2024-03-14 15:45:58] DSConnect.R DSConnect$getToken No response received > > testID = 'TSVVV023' > delResp = timeseriesClient$DeleteItem(testID) INFO [2024-03-14 15:45:58] DatastreamUserCreated_TimeSeries.R TimeSeriesClient$DeleteItem Deleting TSVVV023 You are not logged on. Please recreate the client supplying valid user credentials.ERROR [2024-03-14 15:45:58] DatastreamUserCreated_TimeSeries.R TimeSeriesClient$DeleteItem Exception occured. You are not logged on. Please recreate the client supplying valid user credentials.Error in value[[3L]](cond) : Calls: ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted Running the tests in 'tests/test_UCTS_UpdateItem.R' failed. Complete output: > ProcessTimeseriesResponse = function(tsResponse, tsName) + { + if (!is.null(tsResponse)) + { + # Any request dealing with a single user created item returns a + # DSUserObjectResponse. This has ResponseStatus property that indicates + # success or failure + if (tsResponse$ResponseStatus != DSUserObjectResponseStatus$UserObjectSuccess) + print(paste('Request failed for timeseries', tsName, 'with error ', names(DSUserObjectResponseStatus)[tsResponse$ResponseStatus + 1], ': ', tsResponse$ErrorMessage, '\n\n')) + else if (!is.null(tsResponse$UserObject)) # The timeseries item won't be returned if you set SkipItem true in CreateItem or UpdateItem + { + # Here we simply display the timeseries data using a dataframe. + tsItem = tsResponse$UserObject + metadata = c (Id = tsItem$Id, + Desc = tsItem$Description, + LastModified = as.character(tsItem$LastModified), + StartDate = ifelse (!is.null(tsItem$DateInfo), as.character(tsItem$DateInfo$StartDate), NULL), + EndDate = ifelse(!is.null(tsItem$DateInfo),as.character(tsItem$DateInfo$EndDate), NULL), + Frequency = ifelse(!is.null(tsItem$DateInfo), names(DSUserObjectFrequency)[tsItem$DateInfo$Frequency + 1], NULL), + NoOfValues = ifelse(!is.null(tsItem$DateRange), tsItem$DateRange$ValuesCount , 0)) + df = data.frame(metadata) + print(df) + + if (!is.null(tsItem$DateRange)) + { + df = data.frame(Dates = sapply(tsItem$DateRange$Dates, + FUN = function(x) + { return (as.character(x)) }), + Values = sapply(tsItem$DateRange$Values, + FUN = function(x) + { ifelse (is.null(x), return (NA_character_ ), return (x) )} )) + # Values if NULL, is printed as because, while + # convertind list to vector either by using as.vector or sapply, + # the NULL values in the list are deleted. and thus there will + # be mismatch in no of rows and cannot be put in a dataframe + print(df) + } + } + } + else + print(paste('Timeseries ', tsName, ' successfully updated but item details not returned.')) + } > > testID = 'TSVVV023' > > # Modifying 'TSVVV023' it to be a daily frequency > # series with data from 2000 until 2020. > > # we'll get the list of supported dates between the start and end date. > startDate = as.Date('2000-01-01') > endDate = as.Date('2020-12-31') > freq = DSUserObjectFrequency$Daily Error: object 'DSUserObjectFrequency' not found Execution halted Running the tests in 'tests/testthat.R' failed. Complete output: > library(testthat) > library(DatastreamR) > > test_check("DatastreamR") Error in `test_dir()`: ! No test files found Backtrace: ▆ 1. └─testthat::test_check("DatastreamR") 2. └─testthat::test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed") 3. └─rlang::abort("No test files found") Execution halted * checking PDF version of manual ... [22s] OK * checking HTML version of manual ... OK * DONE Status: 2 ERRORs, 4 WARNINGs, 4 NOTEs