I select the returns of the 12 months of the year Since this is an xts object, it is very easy to If I want to do a subsetting of specific rows using a range of dates, In this case, after theĬoma I wrote NOTHING, indicating that I want ALL COLUMNS! Parameter refers to the COLUMNS to be selected. Negative_returns_em_all <- edhec head(negative_returns_em_all) # Convertible Arbitrage CTA Global Distressed SecuritiesĪs you see, to do subsetting I use squared brackets afher the object,Īnd the first number refers to the ROWS to be selected, and the second In which months the Emeging market fund has had negative returns: I can subset either rows, columns or both. Which are returns of different hedge fund indexes. Tail(edhec) # Convertible Arbitrage CTA Global Distressed Securitiesįrom the results above, we see that this xts object has 13 columns, # Merger Arbitrage Relative Value Short Selling Funds of Funds # Fixed Income Arbitrage Global Macro Long/Short Equity # Emerging Markets Equity Market Neutral Event Driven Head(edhec) # Convertible Arbitrage CTA Global Distressed Securities However, each time I need to use the package, I Once the package is installed in my computer, I do not need to The Package menu (right-bottom of your RStudio). We need the PerformanceAnalytics package, so you can install it from PerformanceAnalytics package is a package with manyįunctions related to Financial analytics. Thousands of available packages to do different types of calculationsĪnd operations. Which comes with the PerformanceAnalytics package. An xts object has the advantage that we can apply severalįunctions to that object for data merging, sorting, selecting, etc. The index of an xts object is like the first column of the object,īut it is actually its index it is not considered a column of the An xts object contains a set ofĬolumns that can be of any type (alphabetic, numeric, boolean) and it The most popular data classes are: ts, zoo and xts. For time series datasets, which are very common in Finance, Actually, youĬan create your own data class, which is a set one or more data R has different data classes (or R objects).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |