question

Upvotes
Accepted
18 0 1 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

· Write an Answer
Upvote
Accepted
5.8k 21 2 6

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 !

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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