library(DatastreamR) # Login using Configuration ds = DataClient$new("Config.ini") # 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)) } ) # print dataframe print(df) # Plotting of all the values # plotting VOD|PH|£ plot(x = df[[1]], y = df[[2]], type = 'o', xlab = "Dates", ylab = "Values", col = "blue", ylim = c(100, 250)) # (provide the highest y-axis limit in ylim parameter to plot all # the data) # add second data series to the same chart using points() and lines() # plotting BARC|PH|£ points(x = df[[1]], y = df[[3]], col="red", pch="+") lines(x = df[[1]], y = df[[3]], type = 'o', col="red",lty=2) # #add third data series to the same chart using points() and lines() # plotting VOD|PL|£ points(x = df[[1]], y = df[[4]], col="dark blue",pch="o") lines(x = df[[1]], df[[4]], col="dark blue", lty=3) # add third data series to the same chart using points() and lines() # plotting BARC|PL|£ points(x = df[[1]], y = df[[5]], col="dark red",pch="+") lines(x = df[[1]], df[[5]], col="dark red", lty=4)