Re: [R] create file with unique names

2008-08-11 Thread Jared O'Connell
How about this? name.length = 10 name = paste(sample(letters,name.length,T),collapse="") Then you can use file.exists(), to check if the file already exists. On Mon, Aug 11, 2008 at 12:28 PM, sara martino <[EMAIL PROTECTED]> wrote: > Hei, > is it possible to create from R a series of files w

Re: [R] How to overlap two density plots?

2008-04-26 Thread Jared O'Connell
My apologies, the previous replies did not show up for me. On Sat, Apr 26, 2008 at 1:49 PM, Jared O'Connell <[EMAIL PROTECTED]> wrote: > Very näively, you could do something like this, > > plot(density(A)) > lines(density(B),col=2) > > , and tinker your xlim and

Re: [R] How to overlap two density plots?

2008-04-26 Thread Jared O'Connell
Very näively, you could do something like this, plot(density(A)) lines(density(B),col=2) , and tinker your xlim and ylim as suitable. The Cairo library gives a pretty example, data(iris) attach(iris) plot(Petal.Length, rep(-0.03,length(Species)), xlim=c(1,7), ylim=c(0,1.7), xlab="Peta

Re: [R] hello

2008-01-24 Thread Jared O'Connell
See the examples under ?png ?pdf On Jan 24, 2008 10:05 AM, elyakhlifi mustapha <[EMAIL PROTECTED]> wrote: > hello, > happy new year. > I want to know if it's possible to send a bar chart from the software R to > an directory. > Thanks. > > > > _

Re: [R] moving or running average

2008-01-07 Thread Jared O'Connell
I'm assuming the package installed correctly (I've only ever installed packages from within R) Have you loaded the zoo package before calling rollmean? ie. > library(zoo) On Jan 7, 2008 4:31 PM, Abu Naser <[EMAIL PROTECTED]> wrote: > > > Hi Jerad, > > Thanks for your quick response. I h

Re: [R] moving or running average

2008-01-07 Thread Jared O'Connell
See ?rollmean in the zoo package. On Jan 7, 2008 3:31 PM, Abu Naser <[EMAIL PROTECTED]> wrote: > > Hi all R users, > > Can anyone please let me know how to do the moving average with R? > > > > With regards, > Abu > > > > > > > > _ >

Re: [R] how to generate uniformly distributed random integers

2007-12-07 Thread Jared O'Connell
You could use sample eg. > sample(1:10,5,replace=T) [1] 1 5 4 6 3 but there may be a more approriate function. On Dec 7, 2007 8:59 AM, kexinz <[EMAIL PROTECTED]> wrote: > > I'm a beginner of R. > I can use runif() to generate uniformly distributed numbers, but I don't > know which function

Re: [R] Recommended textbooks for R?

2007-11-28 Thread Jared O'Connell
This page may be helpful :) http://www.r-project.org/doc/bib/R-books.html Modern Applied Statistics with S is quite broad and very good. On Nov 28, 2007 4:38 PM, Max <[EMAIL PROTECTED]> wrote: > Hi everyone! > > I've recently begun to learn R for my job as the IT department suffers > from lack

Re: [R] NA values

2007-11-21 Thread Jared O'Connell
?is.na On Nov 21, 2007 12:15 PM, Eleni Christodoulou <[EMAIL PROTECTED]> wrote: > Hi all! > > I am new to R and I would like to ask you the following question:How > can I substitute the NA values with 0 in a data frame? I cannot find a > command to check if a value is NA... > > Thank you very muc

Re: [R] File selection by condition

2007-10-02 Thread Jared O'Connell
?any For example, > X <- matrix(1:9,nrow=3) > X [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 > any(X==5) [1] TRUE > any(X==10) [1] FALSE On 10/1/07, Svempa <[EMAIL PROTECTED]> wrote: > > > Thank you, though one small problem remains. How do I define the criter

Re: [R] How to read stored functions

2007-09-25 Thread Jared O'Connell
blem now since HDDs are cheap and function > bodies are generally small. > > But, when you change any function body, you have to repeat that source() > call in local workspace of every project using the functions. > > > Jared O'Connell wrote: > > > > Having

Re: [R] How to read stored functions

2007-09-25 Thread Jared O'Connell
Having your functions in a text file, say "functions.r" and then calling: >source("functions.r") is also an option. This assumes you are in the same directory as " functions.r". Perhaps take a look at ?setwd and ?getwd as well. On 9/25/07, Vladimir Eremeev <[EMAIL PROTECTED]> wrote: > > > >

Re: [R] handle dates in R?

2007-09-13 Thread Jared O'Connell
Take a look at the "chron" package... > as.chron("2004-8-1",format=c(dates="y-m-d")) - > as.chron("1960-1-1",format=c(dates="y-m-d")) Time in days: [1] 16284 On 9/13/07, zhijie zhang <[EMAIL PROTECTED]> wrote: > > Dear Rusers, > I have some data in .csv file like "2004-8-1" and "2004-10-1",