 sfca
|
|
| Total Posts: 842 |
| Joined: May 2004 |
| |
|
| I know there are R users here, such as Eric, who might provide some help. I've just burned through 4 hours trying to do this, and still am nowhere. How do you get and install one of the Contributor packages??? I want to try the copula package, and I can see it in CRAN, and can even download the zip file, but then what? I see no way to install it. It tells me thats where to install it, but theres nothing to help or indicate how. There's no exe or anything. If you try to do it directly at the R prompt like referring to the mirror site, it says use "install.packages" but the documentation is useless without indicating what arguments it wants for the variables. How can I install a package such as "copula" in R? |
|
|
|
 |
|
you have probably tried this but (assuming a windows R interface) there should be a 'Packages' tab on the top . then
Packages -> Install Package(s)...->
this should give you a list of servers .. choose one and then you should see a list of packages....
let me know if this works.
|
|
|
 |
 sfca
|
|
| Total Posts: 842 |
| Joined: May 2004 |
| |
|
| When I choose as mirror any of CA1 or 2 or 3, it says "error in Open.connection(file, "r") : unable to open connection. In addition: warning msg Unable to resolve "cran.r-project.org". |
|
|
|
 |
 sfca
|
|
| Total Posts: 842 |
| Joined: May 2004 |
| |
|
| Sir: Thank you very much. I knew someone could help. The tab you indicated had an install packages from zip file option that I had not seen before. I downloaded the zips from Cran individually (it wanted 4 or 5 different ones) and installed it and now copula works. Thank you. I don't have any idea why its ignoring my mirror request. If you know how to fix that, let me know. But again, thanks! |
|
|
 |
|
Hi,
If I remember well when you've dowloaded your .zip file from the net, you can extract it in a directory named library. For example I used the RGL package (very good for 3D graphs), so I extracted it as a rgl directory in C:\Program Files\R\R-2.4.0\library. Then when you start R you click on load package, you select it and it works. Hope it helps.
cheers!
EDIT: crossed post... |
I am the dark one, -the widower; -the unconsoled,
The prince of Aquitaine at his stricken tower:
My sole star is dead, -and my constellated lute
Bears the black sun of the melancolia.
|
|
|
 |
|
| cool... yeah sometimes.. these things are just so frustrating.. |
|
|
 |
 quantie
|
|
| Total Posts: 861 |
| Joined: Jun 2004 |
| |
|
well it is not really a problem with R but the way you started it... when you start Rgui.exe add a flag Rgui.exe --internet2 and voila everything will work after that..It tells R to look for a proxy automagically.
It is a pain but once you are past the initial glitches it is a wonderful environment. |
|
|
|
 |
|
| Another plea for help...I am loading a zoo time series in R (from csv) and want to expand the dates to include business days (ie every Mon-Fri of the year.) I seem to be able to only expand them to every calendar day, including Saturdays and Sundays. How do I convert to business days? I've tried ts=as.zoo(as.ts(ts)) among other things. Thanks for any help, as I am too retarded to find it. |
|
|
 |
 urnash
|
|
| Total Posts: 549 |
| Joined: Sep 2006 |
| |
|
First of all, I do not use zoo much, for historical reasons. So I'm not sure if the following will help.
I guess that you'd better expand the timeseries and then remove the data for the Saturdays & Sundays.
In page 7 of the quick ref of zoo they use the following two lines to remove the weekends from a eur.usd timeseries
is.weekend <- function(x) ((as.numeric(x) - 2)%%7) < 2
eur.usd <- eur.usd[!is.weekend(time(eur.usd))] |
Alan Moore: Machine. Unexpectedly, I’d invented a time |
|
|
 |
|
| You might consider the timeSeries class in fCalendar: This can handle actual business days (including holidays) for most major financial markets. Then you can use functions like isBizDay. |
For my friends, anything, for my enemies, the law. |
|
 |
|
Thanks. 
I missed that quick ref doc and have been instead using only the others. 
I have not yet used any RMetrics packages, are they any good? |
|
|
|
 |
|
| RMetrics is really a wrapper for a bunch of other packages. I think their timeSeries is a little harder to use than some of the other Date/Time classes, but once you have your data in that format you don't have to change it to work with any of the packages RMetrics has wrapped up, which IMO is pretty valuable. You can try stuff out without getting bogged down in formatting. |
For my friends, anything, for my enemies, the law. |
|
 |
|
RMetrics implements a huge number of functions, and provides wrappers for many more. If you are doing finance in R, you definietly need to know about the RMetrics functions and the 'portfolio' library as well. It will save you a bunch of implementation time.
I agree with another poster who said that the TimeSeries class in RMetrics is a bit difficult to use, but all of the RMetrics functions will work with simple matrices and vectors, and most other time series implementations can be manipulated so that you can use rthem with the RMetrics functions.
Regards,
- Brian |
|
|
|
 |
 urnash
|
|
| Total Posts: 549 |
| Joined: Sep 2006 |
| |
|
| Well, since all the world seems to use Rmetrics, maybe I should do this too. Does anybody know of a good introduction to Rmetrics? The Reference guides are just a bit too succinct for me, and the User guides are quite old. Wuertz keeps referring to his monograph, but as long as that isn’t available I would appreciate if a Phorum member could help me. Thanks in advance. |
Alan Moore: Machine. Unexpectedly, I’d invented a time |
|
 |
|
I am also waiting for better documentation before using it so you aren't alone.  |
|
|
|
 |
|
Yet another dumb R question - please help....already burned a few hours on this one.
I have a (zoo) time series (call it x) with daily price data, weekdays only. I want to make it monthly for the month-end. Using:
x<-aggregate(x,as.yearmon,tail,1)
time(x)<-as.Date(time(x))
gets to monthly data with data values are from the tail of the month as desired. However, the dates are the first of the month. How can I make the dates be the end of month? Thanks in advance for what is expected to be an easy solution. |
|
|
 |
 IAmEric
|
| Phorgy PhynanceBanned |
| Total Posts: 2961 |
| Joined: Oct 2004 |
| |
|
already burned a few hours on this one
Put a dollar value on your time, estimate how many times that has happened, and estimate how long ago you should have just bought Matlab 
Sorry. I know I deserve this  |
|
|
|
 |
 urnash
|
|
| Total Posts: 549 |
| Joined: Sep 2006 |
| |
|
Tradenator: I don't understand your second line. Why do you need it? If I print x before it I get the month as the "name" of each point. But after your second line I get the first of each month as the "name". I don't think that's what you want, though I probably overlooked something... |
Constants aren't. |
|
 |
|
| The second line is supposed to get me back to a daily series, and then I intend to copy down data. If x is a position weight for the month, I would then hold it for the entire month. My problem is that the way I am doing this x starts on the first of the new month rather than the end of the previous one. (Actually, it would be nice to test which day of the month to trade works best...) |
|
|
|
 |
 quantie
|
|
| Total Posts: 861 |
| Joined: Jun 2004 |
| |
|
| eric i would agree the only problem being that there is really no difference between learning matlab and R. Really there are great books on the S-language out there. And matlab makes you pay for every little tool box compared to R where everything is free as in beer. |
|
|
 |
 IAmEric
|
| Phorgy PhynanceBanned |
| Total Posts: 2961 |
| Joined: Oct 2004 |
| |
|
Sorry, didn't really intend to detract from legitimate discussions about R I'll find a suitable thread to respond or maybe create a new one. |
|
|
|
 |
|
No problemo on threadjacking - that's how interesting stuff comes up.
I think I figured this out in the end: create my monthly series as below, create a second (empty) daily series, merge the two, use na.locf to copy down, finally use lag to place the monthly changes where I want. |
|
|
 |
|
| Here's a annoying problem: I can merge (cbind) zoo objects and give the result column names using the suffixes option. But if I have only one column and create a zoo time series, I can't find a way to give it a column name. I've tried merging it with another temporary series, naming columns, and then removing the unwanted column, and I've tried using colname(ts)<-mycolumnname. Any other ideas on this? Thanks. |
|
|
|
 |
 urnash
|
|
| Total Posts: 549 |
| Joined: Sep 2006 |
| |
|
Tradenator: this is an annoying feature of R, S and S-plus. See this link for more information. You can add drop=FALSE to circumvent it. HTH |
Life can only be understood backwards; but it must be lived forwards - Kierkegaard |
|
 |
|
| "A helpful inconsistency" it is called. This solution looks helpful anyway, thanks for pointing it out. |
|
|
|
 |