Re: [R] FW: variable format

2007-09-08 Thread Martin Becker
Frank E Harrell Jr wrote: Martin Becker wrote: Dear Cory, I am not familiar with SAS, but is this what you are looking for? divisionTable - matrix(c(1, New England, 2, Middle Atlantic, 3, East North Central, 4

Re: [R] FW: variable format

2007-09-07 Thread Martin Becker
Dear Cory, I am not familiar with SAS, but is this what you are looking for? divisionTable - matrix(c(1, New England, 2, Middle Atlantic, 3, East North Central, 4, West North Central, 5, South

Re: [R] Behaviour of very large numbers

2007-08-30 Thread Martin Becker
willem vervoort wrote: Dear all, I am struggling to understand this. What happens when you raise a negative value to a power and the result is a very large number? B [1] 47.73092 -51^B [1] -3.190824e+81 # seems fine Well, this seems not to be what you intended to do,

Re: [R] library(fCalendar) timeDate(12.03.2005, format=%d.%m.%Y)

2007-08-22 Thread Martin Becker
an official update on CRAN soon :-) Kind regards, Martin Becker Martin Maechler, ETH Zurich [but different department than D.Wuertz] OL Martin Becker wrote: Dear Ola, I think you spotted a small bug in *package* fCalendar. Explicit specification should

Re: [R] library(fCalendar) timeDate(12.03.2005, format=%d.%m.%Y)

2007-08-20 Thread Martin Becker
Dear Ola, I think you spotted a small bug in *package* fCalendar. Explicit specification should prevent autodetection of the date format, which is not the case for fCalendar v251.70, instead autodetection is done at least once (twice, if actually appropriate). With the following patch, things

Re: [R] R file via SSH

2007-07-13 Thread Martin Becker
You may find screen useful, see e.g. http://tolstoy.newcastle.edu.au/R/e2/help/07/02/10824.html for a short description how to use it with R (reattaching works via screen -r). (Maybe your sysadmin has to install screen first, it's a unix tool.) KR Martin [EMAIL PROTECTED] wrote:

Re: [R] How do I avoid a loop?

2007-06-19 Thread Martin Becker
Gabor Grothendieck wrote: xx is 1 in every position of the first run of TRUE, 2 in every position in the 2nd run of TRUE and so on. The parenthesized expression in the second line converts those to increasing values and multiplying it by x zaps the garbage in the positions that correspond to

Re: [R] How do I avoid a loop?

2007-06-19 Thread Martin Becker
Gabor Grothendieck wrote: xx is 1 in every position of the first run of TRUE, 2 in every position in the 2nd run of TRUE and so on. The parenthesized expression in the second line converts those to increasing values and multiplying it by x zaps the garbage in the positions that correspond to

Re: [R] fSeries - Ox - ver: 240.10068 - Steps to make it work

2007-06-16 Thread Martin Becker
I think there is still a small bug which I reported some time ago to r-sig-finance (https://stat.ethz.ch/pipermail/r-sig-finance/2005q4/000498.html) and which takes effect if the time series is not stored in the variable 'x': The line write(x, file = OxSeries.csv, ncolumns = 1, append =

Re: [R] fSeries - Ox - ver: 240.10068 - Steps to make it work

2007-06-16 Thread Martin Becker
; 0.010761; 0.153406; 0.805877 regards, Ian. - Original Message - From: Martin Becker [EMAIL PROTECTED] To: Ian Gregory [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED] Sent: Saturday, June 16, 2007 8:31 PM Subject: Re: [R] fSeries - Ox - ver: 240.10068 - Steps

Re: [R] I made some progress on my previous systemfit question but still not quite there

2007-05-24 Thread Martin Becker
Leeds, Mark (IED) schrieb: Surprisingly, I played around with some test code and below actually creates equations that look correct. tempmat-matrix(10,nrow=6,ncol=6) restrictmat-diag(6) colnames(tempmat)-c(AUD.l1,CHF.l1,CAD.l1,GBP.l1,EUR.l1,JPY.l 1)

Re: [R] subset

2007-05-04 Thread Martin Becker
elyakhlifi mustapha wrote: hello, subset(swiss, Agriculture 60 Examination != c(14,16), select = c(Agriculture,Examination,Catholic)) Try %in% : subset(swiss, Agriculture 60 Examination %in% c(14,16), select = c(Agriculture,Examination,Catholic)) Agriculture

Re: [R] subset

2007-05-04 Thread Martin Becker
99.68 Herens 89.7 5 100.00 Martigwy78.2 1298.96 Monthey 64.9 798.22 St Maurice 75.9 999.06 Sierre 84.6 399.46 Sion63.1 1396.83 Martin Becker

Re: [R] Jarque-Bera and rnorm()

2007-04-27 Thread Martin Becker
Murali Menon schrieb: Folks, I'm a bit puzzled by the fact that if I generate 100,000 standard normal variates using rnorm() and perform the Jarque-Bera on the resulting vector, I get p-values that vary drastically from run to run. Is this expected? Yes. Surely the p-val should be close

Re: [R] aggregate function

2007-04-23 Thread Martin Becker
If monthly should aggregate per -mm combination, you could try something like aggregate(x$z,list(cut(as.Date(x$Date),m)),mean) for monthly aggregation and aggregate(x$z,list(cut(as.Date(x$Date),y)),mean) for yearly means. If monthly aggregation should aggregate over different years

Re: [R] Error: cannot change value of locked binding for

2007-04-20 Thread Martin Becker
Did you have a look at the posting guide? We have to guess that you are using some version of fOptions in some version of R under some OS, and that you run code from the examples section of ?MonteCarloOption relying on other code from that section which is not mentioned at all. Given that these

Re: [R] Reading a csv file row by row

2007-04-06 Thread Martin Becker
readLines (which is mentioned in the See also section of ?scan with the hint to read a file a line at a time) should work. Regards, Martin Yuchen Luo schrieb: Hi, my friends. When a data file is large, loading the whole file into the memory all together is not feasible. A feasible way is

Re: [R] GarchOxFit Interface

2007-03-03 Thread Martin Becker
[EMAIL PROTECTED] wrote: Hello, I am having problems with the GarchOxFit. I have my Ox Console instaled in c:\Program Files\ox, and when I execute the GarchOxFit the result is C:\Ox\bin\oxl.exe not found. I there any posiblility to execute the command without installing again Ox in c:\?

Re: [R] count sequence of integers

2007-02-15 Thread Martin Becker
Samuel Kemp wrote: Hi, I would like to be able to count a sequence of numbers. For example, given a vector of the following integers (1,1,1,2,2,2,2,3,3,3,3,3,3,1,1,1,1, 3,3) the function would return (3, 4, 6, 4,2) Does anyone have any cool ideas to solve this? Maybe not the most

Re: [R] jump in sequence

2007-01-30 Thread Martin Becker
Adrian DUSA wrote: Dear list, This should be a simple one, I just cannot see it. I need to generate a sequence of the form: 4 5 6 13 14 15 22 23 24 That is: starting with 4, make a 3 numbers sequence, jump 6, then another 3 and so on. I can create a whole vector with: myvec -

Re: [R] How to optimize this loop ?

2007-01-18 Thread Martin Becker
Petr Pikal schrieb: Hi discard your loop do not optimise it. rle is your friend I do not agree. For some purposes, an efficient loop is faster. IMHO this is one of these purposes. I propose the following modification of the loop (to increase speed): myfun1 - function(series=c(3, 4,

Re: [R] How to optimize this loop ? (correction)

2007-01-18 Thread Martin Becker
Sorry, I accidentaly lost one line of the function code (result -0), see below... Regards, Martin Martin Becker schrieb: myfun1 - function(series=c(3, 4, 10,14,8,3,4,6,9)) { result - 0# NEW len-length(series) for (i in (len-1):1) { if (series[i]series[len

Re: [R] Row limit for read.table

2007-01-17 Thread Martin Becker
Frank McCown schrieb: I have been trying to read in a large data set using read.table, but I've only been able to grab the first 50,871 rows of the total 122,269 rows. f - read.table(http://www.cs.odu.edu/~fmccown/R/Tchange_rates_crawled.dat;, header=TRUE, nrows=123000, comment.char=,

Re: [R] Kernel density output

2007-01-15 Thread Martin Becker
Florent Bresson schrieb: Hi, I'm using the density() command for a given vector x and I would like to know how to get the estimated value of the density for each element of the vector x instead of values corresponding to points from a grid. Maybe not the best/most efficient way to do

Re: [R] R editor vs. Tinn-R

2007-01-12 Thread Martin Becker
Farrel Buchinsky wrote: Have you used Tinn-R and what landmines await the inexperienced? Depending on which button you press in Tinn-R, the clipboard is used to transfer the commands to R, so sometimes you can't rely on the previous contents of the clipboard while using Tinn-R. If you use

Re: [R] R editor vs. Tinn-R

2007-01-12 Thread Martin Becker
selection (source) button, e.g. Thanks Farrel Regards, Martin Martin Becker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Farrel Buchinsky wrote: Have you used Tinn-R and what landmines await the inexperienced? Depending on which button you press in Tinn-R, the clipboard

Re: [R] R editor vs. Tinn-R

2007-01-12 Thread Martin Becker
Zitat von BBands [EMAIL PROTECTED]: On 1/12/07, Martin Becker [EMAIL PROTECTED] wrote: Depending on which button you press in Tinn-R, the clipboard is used to transfer the commands to R, so sometimes you can't rely on the previous contents of the clipboard while using Tinn-R. If you use