Thanks to Robert, Jeff and Adam for their advice in pointing out that getReturns/returns(fSeries) function calculates ln(Pt/Pt-1)not (Pt/Pt-1)-1 and how the latter should be calculated.

I used the suggestion by Robert below (Method 1) where I just had to make a simple change to the argument name and it worked perfectly! I reproduced their advice below.

Method 1 (By Robert)

Try 'method' instead of 'type'. This works

getReturns(MSFT, method = "discrete", na.rm = F, trim = F, percentage = T)

Robert

Method 2 (By Jeff)

library(quantmod)

my.ts <- timeSeries(c(rep(NA,10),6500,8100,8010,7930),
as.Date('1970-01-01')+0:13)

Delt(my.ts)
           Delt.1.arithmetic
1970-01-01                NA
1970-01-02                NA
1970-01-03                NA
1970-01-04                NA
1970-01-05                NA
1970-01-06                NA
1970-01-07                NA
1970-01-08                NA
1970-01-09                NA
1970-01-10                NA
1970-01-11                NA
1970-01-12       0.246153846
1970-01-13      -0.011111111
1970-01-14      -0.009987516

What you are getting, as Adam points out, is log returns.

> Delt(my.ts, type='log')
            Delt.1.log
1970-01-01          NA
1970-01-02          NA
1970-01-03          NA
1970-01-04          NA
1970-01-05          NA
1970-01-06          NA
1970-01-07          NA
1970-01-08          NA
1970-01-09          NA
1970-01-10          NA
1970-01-11          NA
1970-01-12  0.22006188
1970-01-13 -0.01117330
1970-01-14 -0.01003773

The xts library also has a family of functions to calculate period returns (and much more).

?periodReturn

Best Regards,
WY



**********************************************************

The information provided in this e-mail is confidential and is for the sole use of the recipient. It may not be disclosed, copied or distributed in any form without the express permission of Henderson Global Investors and to the extent that it is passed on, care must be taken to ensure that this is in a form which accurately reflects the information presented here.

Whilst Henderson Global Investors believe that the information is correct at the date of this e-mail, no warranty or representation is given to this effect and no responsibility can be accepted by Henderson Global Investors to any end users for any action taken on the basis of this information.

Henderson Global Investors is the name under which Henderson Global Investors Limited (registered no. 906355), Henderson Fund Management plc (registered no. 2607112), Henderson Investment Funds Limited (registered no. 2678531), Henderson Investment Management Limited (registered no. 1795354) Henderson Alternative Investment Advisor Limited (registered no. 962757) and Henderson Equity Partners Limited (registered no.2606646) (each incorporated and registered in England and Wales with registered office at 4 Broadgate, London EC2M 2DA and authorised and regulated by the Financial Services Authority) provide investment products and services.  Henderson Secretarial Services Limited (incorporated and registered in England and Wales, registered no. 1471624, registered office 4 Broadgate, London EC2M 2DA) is the name under which company secretarial services are provided. All these companies are wholly owned subsidiaries of Henderson Group plc (incorporated and registered in England and Wales, registered no. 2072534, registered office 4 Broadgate, London EC2M 2DA).

We may record telephone calls or email for our mutual protection and to improve customer service. 

**********************************************************
	[[alternative HTML version deleted]]

