question

Upvotes
Accepted
18 0 0 2

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 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvote
Accepted
1.4k 6 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 5.0 MiB each and 10.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 !

Click below to post an Idea Post Idea