Browse wiki

From MoxyWiki

Adjust for inflation function
Currency AUD +
Modification dateThis property is a special property in this wiki. 28 July 2010 03:18:29  +
RScript
function(inputValue, fromYear, toYear){
#Step 1 load in the CPI data
cpi = sparql("SELECT ?x WHERE{<http://www.moxy.com.au/Wiki/a#Australian_Consumer_Price_Index> prop:RData ?x}");

#Average the CPI index data by year
cpi$Year = substr(cpi$Quarter, 5, 8);

# Summarise the data by year
cpiYear = tapply(cpi$Index, cpi$Year, mean);

#Convert from fromYear to base
targetVal = inputValue * cpiYear[as.character(toYear)] / cpiYear[as.character(fromYear)];
targetVal 
}
Categories Function
hide properties that link here 
Convert Australian Nominal Dollars to Real Dollars + redirect page
 

 

Enter the name of the page to start browsing from.
Personal tools
Toolbox