CharlesCara / DatastreamDSWS2R

Functions and a R5 class that allows data to be downloaded and uploaded to the LSEG Datastream database via the DSWS server
20 stars 9 forks source link

Dataframe vs xts #15

Open miguellacerda opened 5 years ago

miguellacerda commented 5 years ago

Would it be possible to add an optional parameter to return data (e.g. via a timeSeriesRequest) as a data frame, rather than an xts object? I find that I almost always wrap my requests in as.data.frame, because this format is more useful for subsequent manipulations (e.g. performing joins to other data). The data frame is also a standard format that most R users will be familiar with it, while xts is not as well known.

CharlesCara commented 5 years ago

Yes, that could be a useful enhancement. My thoughts are that there should be possible to set a default option for the return type. eg

mydsws <- dsws$new()
myData <- mydsws$snapshotRequest(instrument = c("ABF","RIO","WPP"),
                               datatype = "P",
                               requestDate = "0D",
                               returnType = getOption("DSWS.ReturnType"))