Re: [R] Google's R Style Guide

2009-08-29 Thread diegol
Max Kuhn wrote: Perhaps this is obvious, but Ive never understood why this is the general convention: An opening curly brace should never go on its own line; I tend to do this: f - function() { if (TRUE) { cat(TRUE!!\n) } else { cat(FALSE!!\n) } }

[R] Same initial seed

2009-06-28 Thread diegol
Hello, I have tried a few searches without luck before posting, since this one seems a pretty basic question. I am using R 2.7.0 on WinXP, as I have long started using this version for my thesis work and am reluctant to update fearing consistency/backward compatibility issues could happen. I

Re: [R] Same initial seed

2009-06-28 Thread diegol
Update: I had tried, immediately after launching the console: rm(list=ls()) which did not seem to affect .Random.seed. But now I try: rm(.Random.seed) which seems to force .Random.seed to regenerate from current time. Can I feel confident to have solved the problem? Thanks! diegol

Re: [R] Same initial seed

2009-06-28 Thread diegol
Great. Your suggestion is most welcome, everything is clear now. Thank you for your time, Duncan! Regards, Diego Duncan Murdoch-2 wrote: diegol wrote: Hello, I have tried a few searches without luck before posting, since this one seems a pretty basic question. I am using R 2.7.0

[R] Testing for Inequality à la select case

2009-03-15 Thread diegol
Using R 2.7.0 under WinXP. I need to write a function that takes a non-negative vector and returns the parallell maximum between a percentage of this argument and a fixed value. Both the percentages and the fixed values depend on which interval x falls in. Intervals are as follows: From |

Re: [R] Testing for Inequality à la select case

2009-03-15 Thread diegol
) 1) stop(x must have length 1) idx - which(x=range)[1] max( x*perc[idx], min[idx] ) } }) Thank you very much for your help. Diego Stavros Macrakis-2 wrote: On Sun, Mar 15, 2009 at 4:12 PM, diegol diego...@gmail.com wrote: ...This could be done in Excel much tidier in my

Re: [R] Testing for Inequality à la select case

2009-03-15 Thread diegol
in given ranges (the break argument), and then using this factor to give the appropriate percentage. Hope this helps, baptiste On 15 Mar 2009, at 20:12, diegol wrote: Using R 2.7.0 under WinXP. I need to write a function that takes a non-negative vector and returns the parallell

Re: [R] Testing for Inequality à la select case

2009-03-15 Thread diegol
) but it's getting late here so i may well be missing an important thing. Hope this helps, baptiste On 15 Mar 2009, at 23:19, diegol wrote: Hello Baptiste, I am not very sure how I'd go about that. Taking the range, perc and min vectors from Stavros' response: range= c

Re: [R] Testing for Inequality à la select case

2009-03-15 Thread diegol
That's what I meant by element-by -element. A vector in R corresponds to a row or a column in Excel, and a vector operation in R corresponds to a row or column of formulae, e.g. Excel A B C 1) 5 10 a1+b1 (= 15) 2) 3 2 a2+b2 (= 5) etc. R A -

Re: [R] Percent damage distribution

2008-12-27 Thread diegol
it with a standard method. Regards, Diego Ben Bolker wrote: diegol diegol81 at gmail.com writes: R version: 2.7.0 Running on: WinXP I am trying to model damage from fire losses (given that the loss occurred). Since I have the individual insured amounts, rather than sampling

Re: [R] Percent damage distribution

2008-12-26 Thread diegol
was not accepted yet, so it probably does not show in the thread, but there I stated I was going to use a beta distribution, so my problem is solved by now. If you want, we may continue this conversation privately. Many thanks. On Thu, 25 Dec 2008, diegol wrote: R version: 2.7.0 Running on: WinXP

[R] Percent damage distribution

2008-12-25 Thread diegol
R version: 2.7.0 Running on: WinXP I am trying to model damage from fire losses (given that the loss occurred). Since I have the individual insured amounts, rather than sampling dollar damage from a continuous distribution ranging from 0 to infinity, I want to sample from a percent damage

[R] Adding x-axis values to a histogram

2008-03-11 Thread diegol
Dear useRs, Is there a way one can add x-axis values to a histogram? Example: z = rgamma(n=1000, shape = 8, scale = 1000) hist(z, breaks = 30) Currently I see 4 x-axis values: 5000, 1, 15000, 2. Can I add more values or modify the ones currently showing? I tried ?hist, yet couldn't

Re: [R] Announce: Contributed Documentation

2008-01-05 Thread diegol
Dear Prof. Vincent Goulet, Vincent Goulet wrote: If there is any interest, I might prepare an English version of the document. Maybe a little little late, but if by chance you happened to create the English version of the document, I would also be interested in reading it. Thank you

Re: [R] updating R version and packages.

2007-12-31 Thread diegol
A menu-driven alternative: in the R Console GUI, select Packages | Update packages. Milton Cezar Ribeiro wrote: Dear All, Is there a way of I update automatically the R version and the respective packages which I have installed on my computer? Case not, how can I know about what

Re: [R] MS Excel Data

2007-12-08 Thread diegol
Prof Brian Ripley wrote: Why not read the 'R Data Import/Export' manual? It ships with R, or can be accessed from http://cran.r-project.org/manuals.html . Dear Professor, I'd like to make a suggestion. When I first read some articles ands posts about R's wonderful capabilities, the

Re: [R] Packages - a great resource, but hard to find the right one

2007-11-25 Thread diegol
Hi all, I've been reading your suggestions and I'd like to share my thoghts, which might be common to people not so deeply involved in the development of R. One of the advantages of R is that it's an open source software, meaning that anyone can peruse the code for whatever purpose they might