Forums  > Software  > Help with R  
     
Page 1 of 18Goto to page: 1, 2, 3 ... 17, 18 Next
Display using:  

sfca


Total Posts: 842
Joined: May 2004
 
Posted: 2006-11-09 00:02
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? 

kanukatchit


Total Posts: 249
Joined: Jun 2005
 
Posted: 2006-11-09 00:09
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
 
Posted: 2006-11-09 00:28
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
 
Posted: 2006-11-09 00:51
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! 

Eldesdichado


Total Posts: 366
Joined: Apr 2005
 
Posted: 2006-11-09 00:53
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.

kanukatchit


Total Posts: 249
Joined: Jun 2005
 
Posted: 2006-11-09 01:09
cool... yeah sometimes.. these things are just so frustrating..

quantie


Total Posts: 861
Joined: Jun 2004
 
Posted: 2006-11-12 00:01
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.

Tradenator


Total Posts: 1178
Joined: Sep 2006
 
Posted: 2006-12-14 10:41
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
 
Posted: 2006-12-14 11:52

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

billWalker


Total Posts: 137
Joined: Feb 2005
 
Posted: 2006-12-14 15:49
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.

Tradenator


Total Posts: 1178
Joined: Sep 2006
 
Posted: 2006-12-14 22:40

Thanks.  Beer

I missed that quick ref doc and have been instead using only the others.  Head against Wall

I have not yet used any RMetrics packages, are they any good?


billWalker


Total Posts: 137
Joined: Feb 2005
 
Posted: 2006-12-15 20:16
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.

braverock


Total Posts: 10
Joined: Jan 2007
 
Posted: 2007-01-01 21:04
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
 
Posted: 2007-01-03 09:56
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

Tradenator


Total Posts: 1178
Joined: Sep 2006
 
Posted: 2007-01-03 12:41
I am also waiting for better documentation before using it so you aren't alone. Head against Wall

Tradenator


Total Posts: 1178
Joined: Sep 2006
 
Posted: 2007-01-11 12:03

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 Phynance
Banned
Total Posts: 2961
Joined: Oct 2004
 
Posted: 2007-01-11 16:21
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 Wink

Sorry. I know I deserve this Hammertime

urnash


Total Posts: 549
Joined: Sep 2006
 
Posted: 2007-01-11 17:26

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.

Tradenator


Total Posts: 1178
Joined: Sep 2006
 
Posted: 2007-01-11 19:46
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
 
Posted: 2007-01-12 04:39
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 Phynance
Banned
Total Posts: 2961
Joined: Oct 2004
 
Posted: 2007-01-12 04:46
Sorry, didn't really intend to detract from legitimate discussions about R Blush I'll find a suitable thread to respond or maybe create a new one.

Tradenator


Total Posts: 1178
Joined: Sep 2006
 
Posted: 2007-01-15 09:21

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.


Tradenator


Total Posts: 1178
Joined: Sep 2006
 
Posted: 2007-02-15 01:41
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
 
Posted: 2007-02-15 09:04

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

Tradenator


Total Posts: 1178
Joined: Sep 2006
 
Posted: 2007-02-15 11:35
"A helpful inconsistency" it is called.  This solution looks helpful anyway, thanks for pointing it out.
Previous Thread :: Next Thread 
Page 1 of 18Goto to page: 1, 2, 3 ... 17, 18 Next