question

Upvotes
Accepted
18 0 0 3

I am using the R version of DSWS and trying to retrieve the IDs (or characteristics) from a list. But, it gives error

mydsws <- dsws$new(username=DatastreamUsername, password=DatastreamPassword)

mynames<-mydsws$snapshotRequest(instrument = "LS&PCOMP",datatype = c("ISIN"),requestDate="0D")

Error in `[<-.data.frame`(`*tmp*`, , 1, value = c("891399", "916328", :

replacement has 505 rows, data has 1

datastream-apidsws-apidatastream
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvote
Accepted
2.3k 16 2 2

Hi @Giulio.nicoletti,


I looked into 'LS&PCOMP ' on Datastream, it looks to be a list of constituents.


Looking for 'Datastream for R' online, I found the repo for the library 'DatastreamDSWS2R' that I'm guessing you are using. There, it suggests using the 'listRequest' function for constituent list requests. I tried the bellow which worked:


mynames <- mydsws$listRequest(instrument = c("LS&PCOMP"), requestDate="0D")


Does this return the results you expected?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you @jonathan.legrand ! This works well. One the list is retrieved, this is long so it seems I have to loop over blocks of it or get an error message when using $timeSeriesListRequest, but this is fine I guess. Thanks again !